diff options
author | dynaflash <[email protected]> | 2012-02-17 17:53:31 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2012-02-17 17:53:31 +0000 |
commit | 616e9202fb4e157ca6b9de5d45f1064e7bf858c3 (patch) | |
tree | 5e4cdd369ca716a46373a80061bd908041d33231 | |
parent | 1a400b7b16844ee5455a1a994f89e2a7db95551b (diff) |
MacGui: Advanced Options fixes
- Fix advanced FFmpeg options in two-pass mode.
- Fix advanced FFmpeg options when re-scanning a queued item.
-- Thanks Rodeo for the fixes!
- Add HBAdvancedController.h to the HandBrake.app target in the xcode project.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4452 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/Controller.m | 53 | ||||
-rw-r--r-- | macosx/HandBrake.xcodeproj/project.pbxproj | 2 |
2 files changed, 30 insertions, 25 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m index feb490dae..7a1aa1c58 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -2349,7 +2349,7 @@ fWorkingCount = 0; [queueFileJob setObject:[fVidEncoderPopUp titleOfSelectedItem] forKey:@"VideoEncoder"]; /* x264 Option String */ [queueFileJob setObject:[fAdvancedOptions optionsString] forKey:@"x264Option"]; - /* FFMpeg (lavc) Option String */ + /* FFmpeg (lavc) Option String */ [queueFileJob setObject:[fAdvancedOptions optionsStringLavc] forKey:@"lavcOption"]; [queueFileJob setObject:[NSNumber numberWithInt:[[fVidQualityMatrix selectedCell] tag] + 1] forKey:@"VideoQualityType"]; @@ -2727,8 +2727,16 @@ fWorkingCount = 0; job->pass = 2; - job->advanced_opts = (char *)calloc(1024, 1); /* Fixme, this just leaks */ - strcpy(job->advanced_opts, [[queueToApply objectForKey:@"x264Option"] UTF8String]); + if( job->vcodec == HB_VCODEC_X264 ) + { + job->advanced_opts = (char *)calloc(1024, 1); /* Fixme, this just leaks */ + strcpy(job->advanced_opts, [[queueToApply objectForKey:@"x264Option"] UTF8String]); + } + else + { + job->advanced_opts = (char *)calloc(1024, 1); /* Fixme, this just leaks */ + strcpy(job->advanced_opts, [[queueToApply objectForKey:@"lavcOption"] UTF8String]); + } hb_add( fQueueEncodeLibhb, job ); @@ -2817,6 +2825,7 @@ fWorkingCount = 0; /* We set the advanced opt string here if applicable*/ [fVidEncoderPopUp selectItemWithTitle:[queueToApply objectForKey:@"VideoEncoder"]]; [fAdvancedOptions setOptions:[queueToApply objectForKey:@"x264Option"]]; + [fAdvancedOptions setLavcOptions:[queueToApply objectForKey:@"lavcOption"]]; /* Lets run through the following functions to get variables set there */ [self videoEncoderPopUpChanged:nil]; @@ -3079,7 +3088,7 @@ fWorkingCount = 0; job->chapter_markers = 0; - if( job->vcodec & HB_VCODEC_X264 ) + if( job->vcodec == HB_VCODEC_X264 ) { /* Below Sends x264 options to the core library if x264 is selected*/ @@ -3560,7 +3569,7 @@ bool one_burned = FALSE; job->chapter_markers = 0; } - if( job->vcodec & HB_VCODEC_X264 ) + if( job->vcodec == HB_VCODEC_X264 ) { if ([[queueToApply objectForKey:@"Mp4iPodCompatible"] intValue] == 1) { @@ -4930,7 +4939,7 @@ the user is using "Custom" settings by determining the sender*/ [fVidQualitySlider setNumberOfTickMarks:(([fVidQualitySlider maxValue] - [fVidQualitySlider minValue]) * fractionalGranularity) + 1]; qpRFLabelString = @"RF:"; } - /* ffmpeg MPEG-2/4 1-31 */ + /* FFmpeg MPEG-2/4 1-31 */ if ([[fVidEncoderPopUp selectedItem] tag] & HB_VCODEC_FFMPEG_MASK ) { [fVidQualitySlider setMinValue:1.0]; @@ -5686,28 +5695,21 @@ return YES; [fVidEncoderPopUp selectItemWithTitle:[chosenPreset objectForKey:@"VideoEncoder"]]; [self videoEncoderPopUpChanged:nil]; /* We set the advanced opt string here if applicable*/ - if ([[fVidEncoderPopUp selectedItem] tag] == HB_VCODEC_X264) + if ([chosenPreset objectForKey:@"x264Option"]) { - if ([chosenPreset objectForKey:@"x264Option"]) - { - [fAdvancedOptions setOptions:[chosenPreset objectForKey:@"x264Option"]]; - } - else - { - [fAdvancedOptions setOptions:@""]; - } - + [fAdvancedOptions setOptions:[chosenPreset objectForKey:@"x264Option"]]; } - else // we are ffmpeg encoder + else { - if ([chosenPreset objectForKey:@"lavcOption"]) - { - [fAdvancedOptions setLavcOptions:[chosenPreset objectForKey:@"lavcOption"]]; - } - else - { - [fAdvancedOptions setLavcOptions:@""]; - } + [fAdvancedOptions setOptions:@""]; + } + if ([chosenPreset objectForKey:@"lavcOption"]) + { + [fAdvancedOptions setLavcOptions:[chosenPreset objectForKey:@"lavcOption"]]; + } + else + { + [fAdvancedOptions setLavcOptions:@""]; } /* Lets run through the following functions to get variables set there */ @@ -6286,6 +6288,7 @@ return YES; [preset setObject:[fVidEncoderPopUp titleOfSelectedItem] forKey:@"VideoEncoder"]; /* x264 Option String */ [preset setObject:[fAdvancedOptions optionsString] forKey:@"x264Option"]; + /* FFmpeg (lavc) Option String */ [preset setObject:[fAdvancedOptions optionsStringLavc] forKey:@"lavcOption"]; /* though there are actually only 0 - 1 types available in the ui we need to map to the old 0 - 2 diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index 27ddfcfb2..3f8c59561 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -309,6 +309,7 @@ 27D6C73E14B102DA00B785E4 /* libvorbisenc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisenc.a; path = external/contrib/lib/libvorbisenc.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C73F14B102DA00B785E4 /* libx264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libx264.a; path = external/contrib/lib/libx264.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27D6C74014B102DA00B785E4 /* libxml2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxml2.a; path = external/contrib/lib/libxml2.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 34FF2FC014EEC363004C2400 /* HBAdvancedController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBAdvancedController.h; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -506,6 +507,7 @@ 273F208D14ADBE670021BE6D /* ChapterTitles.m */, 273F208E14ADBE670021BE6D /* Controller.h */, 273F208F14ADBE670021BE6D /* Controller.m */, + 34FF2FC014EEC363004C2400 /* HBAdvancedController.h */, 273F209014ADBE670021BE6D /* HBAdvancedController.m */, 273F209114ADBE670021BE6D /* HBAudio.h */, 273F209214ADBE670021BE6D /* HBAudio.m */, |