diff options
author | dynaflash <[email protected]> | 2007-04-13 17:26:43 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-04-13 17:26:43 +0000 |
commit | 846953ba473e9d45a1905e6adf85c8dff5890fc3 (patch) | |
tree | c11dcd6befa4a4ac80717091c0e6348ebf73ddca /macosx | |
parent | 75c1aa3986a8b3a11bcaf89e9815df4216b24335 (diff) |
MacGui: Fix x264 options strings in the queue by implementing patch from Nyx. Thanks Nyx!
- x264 options passing to the queue no longer crash HandBrake.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@503 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 87e81bfc3..06f81047a 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -781,25 +781,29 @@ static int FormatSettings[3][4] = /* Set this flag to switch from Constant Quantizer(default) to Constant Rate Factor Thanks jbrjake Currently only used with Constant Quality setting*/ - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultCrf"] > 0 && [fVidQualityMatrix selectedRow] == 2) - { + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultCrf"] > 0 && [fVidQualityMatrix selectedRow] == 2) + { /* Can only be used with svn rev >= 89 */ job->crf = 1; - } + } /* Below Sends x264 options to the core library if x264 is selected*/ /* First we look to see if a user preset has been selected that contains a x264 optional string CurUserPresetChosenNum = nil */ if (curUserPresetChosenNum != nil) { - /* Lets use this to see if the proper string is being passed in the gui. We can comment out if need be. - for public use we have the field hidden in the nib */ - [fDisplayX264Options setStringValue: [NSString stringWithFormat:@"%@",[chosenPreset valueForKey:@"x264Option"]]]; - job->x264opts = [[chosenPreset valueForKey:@"x264Option"] cString]; + + /* Lets use this as per Nyx, Thanks Nyx! */ + job->x264opts = (const char *)calloc(1024, 1); /* Fixme, this just leaks */ + strcpy((char *)job->x264opts, [[chosenPreset valueForKey:@"x264Option"] UTF8String]); + //job->x264opts = [[chosenPreset valueForKey:@"x264Option"] cString]; } else { /* if not, then we check to see if there is a x264 opt in the preferences and use that if we want */ - job->x264opts = [[[NSUserDefaults standardUserDefaults] stringForKey:@"DefAdvancedx264Flags"] UTF8String]; + //job->x264opts = [[[NSUserDefaults standardUserDefaults] stringForKey:@"DefAdvancedx264Flags"] UTF8String]; + /* Lets use this as per Nyx, Thanks Nyx! */ + job->x264opts = (const char *)calloc(1024, 1); /* Fixme, this just leaks */ + strcpy((char *)job->x264opts, [[[NSUserDefaults standardUserDefaults] stringForKey:@"DefAdvancedx264Flags"] UTF8String]); } @@ -902,7 +906,22 @@ static int FormatSettings[3][4] = job->pass = 1; hb_add( fHandle, job ); job->pass = 2; - job->x264opts = [[[NSUserDefaults standardUserDefaults] stringForKey:@"DefAdvancedx264Flags"] UTF8String]; + /* First we look to see if a user preset has been selected that contains a x264 optional string CurUserPresetChosenNum = nil */ + if (curUserPresetChosenNum != nil) + { + + /* Lets use this as per Nyx, Thanks Nyx! */ + job->x264opts = (const char *)calloc(1024, 1); /* Fixme, this just leaks */ + strcpy((char *)job->x264opts, [[chosenPreset valueForKey:@"x264Option"] UTF8String]); + //job->x264opts = [[chosenPreset valueForKey:@"x264Option"] cString]; + } + else + { + //job->x264opts = [[[NSUserDefaults standardUserDefaults] stringForKey:@"DefAdvancedx264Flags"] UTF8String]; + /* Lets use this as per Nyx, Thanks Nyx! */ + job->x264opts = (const char *)calloc(1024,1); /* Fixme, this just leaks */ + strcpy((char *)job->x264opts, [[[NSUserDefaults standardUserDefaults]stringForKey:@"DefAdvancedx264Flags"] UTF8String]); + } hb_add( fHandle, job ); } else |