From d50ee9cf20e25c1e1a2c69d86cb99d0539f037e3 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Wed, 16 Jan 2013 18:14:07 +0000 Subject: MacGui: retain the current storage width and height and use it when unparsing the x264 options. This is done in calculatePictureSizing as it is called whenever width or height change. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5175 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.h | 2 ++ macosx/Controller.m | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'macosx') diff --git a/macosx/Controller.h b/macosx/Controller.h index a8ba2631e..c7667a620 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -79,6 +79,8 @@ BOOL fIsDragging; // Text Field to show the expanded opts from unparse() IBOutlet NSTextField * fDisplayX264PresetsUnparseTextField; char * fX264PresetsUnparsedUTF8String; + NSUInteger fX264PresetsHeightForUnparse; + NSUInteger fX264PresetsWidthForUnparse; /* Advanced options tab */ HBAdvancedController * fAdvancedOptions; diff --git a/macosx/Controller.m b/macosx/Controller.m index d10bcce3e..d19f7f754 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -5579,7 +5579,8 @@ the user is using "Custom" settings by determining the sender*/ const char *advanced_opts = NULL; const char *h264_profile = NULL; const char *h264_level = NULL; - int unparse_width, unparse_height; + int width = 1; + int height = 1; // prepare the tune, advanced options, profile and level if ([(tmpString = [self x264Tune]) length]) { @@ -5597,9 +5598,12 @@ the user is using "Custom" settings by determining the sender*/ { h264_level = [tmpString UTF8String]; } - // prepare the width and height (FIXME) - unparse_width = 1280; - unparse_height = 720; + // width and height must be non-zero + if (fX264PresetsWidthForUnparse && fX264PresetsHeightForUnparse) + { + width = fX264PresetsWidthForUnparse; + height = fX264PresetsHeightForUnparse; + } // free the previous unparsed string free(fX264PresetsUnparsedUTF8String); // now, unparse @@ -5608,8 +5612,7 @@ the user is using "Custom" settings by determining the sender*/ advanced_opts, h264_profile, h264_level, - unparse_width, - unparse_height); + width, height); // update the text field [fDisplayX264PresetsUnparseTextField setStringValue: [NSString stringWithFormat:@"x264 Unparse: %s", @@ -5771,6 +5774,12 @@ the user is using "Custom" settings by determining the sender*/ } [fVideoFiltersField setStringValue: [NSString stringWithFormat:@"Video Filters: %@", videoFilters]]; + /* Store storage resolution for unparse */ + fX264PresetsWidthForUnparse = fTitle->job->width; + fX264PresetsHeightForUnparse = fTitle->job->height; + // width or height may have changed, unparse + [self x264PresetsChangedDisplayExpandedOptions:nil]; + //[fPictureController reloadStillPreview]; } -- cgit v1.2.3