]> granicus.if.org Git - handbrake/commitdiff
MacGui: retain the current storage width and height and use it when unparsing the...
authorRodeo <tdskywalker@gmail.com>
Wed, 16 Jan 2013 18:14:07 +0000 (18:14 +0000)
committerRodeo <tdskywalker@gmail.com>
Wed, 16 Jan 2013 18:14:07 +0000 (18:14 +0000)
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
macosx/Controller.m

index a8ba2631eafccdc91730522bc31c2bd1c053cd2f..c7667a620245b58a6efe080ef406cc81ed348e29 100644 (file)
@@ -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;
index d10bcce3e06188b6cd124b932201536958a1cafd..d19f7f7541d3e52651e65333398ee778788848b7 100644 (file)
@@ -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]; 
 }