]> granicus.if.org Git - handbrake/commitdiff
MacGui: more refactoring, bugfixes.
authorRodeo <tdskywalker@gmail.com>
Wed, 2 Jan 2013 19:36:28 +0000 (19:36 +0000)
committerRodeo <tdskywalker@gmail.com>
Wed, 2 Jan 2013 19:36:28 +0000 (19:36 +0000)
Apologies if anything breaks.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5131 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.m
macosx/HBQueueController.mm

index 6b0e0968b80f19f9c3bfa9e9011cb12a70a51068..86576bebde3598bd21cb38f21b5349c969261cbe 100644 (file)
@@ -305,7 +305,6 @@ BOOL                        fIsDragging;
 - (void) setupX264PresetsWidgets: (id) sender;
 - (void) enableX264Widgets: (bool) enable;
 - (IBAction) updateX264Widgets: (id) sender;
-- (IBAction) x264PresetsSetJobVariables: (id) sender;
 - (IBAction) x264PresetsChangedDisplayExpandedOptions: (id) sender;
 
 - (IBAction) encodeStartStopPopUpChanged: (id) sender;
index 5e0a3b057dd07c3b61d9b555082b00f572f2ee41..5534268956751fbc8a4210cf1cdc4aa50b457659 100644 (file)
@@ -2532,40 +2532,50 @@ fWorkingCount = 0;
        /* Video encoder */
        [queueFileJob setObject:[fVidEncoderPopUp titleOfSelectedItem] forKey:@"VideoEncoder"];
        
-    /* x264 Preset, Tune, Profile, and Levels */
-    if (![fx264UseAdvancedOptionsCheck state])
+    /* x264 advanced options */
+    if ([fx264UseAdvancedOptionsCheck state])
     {
-        // Set the x264 Preset
-        [queueFileJob setObject:[NSString stringWithFormat:@"%@", [fX264PresetSelectedTextField stringValue]] forKey:@"x264Preset"];
-        
+        // we are using the advanced panel
+        [queueFileJob setObject: [NSNumber numberWithInt:1] forKey: @"x264UseAdvancedOptions"];
+    }
+    else
+    {
+        // we are using the x264 system
+        NSString *x264Preset      = [fX264PresetSelectedTextField stringValue];
+        NSString *x264Tune        = @""; // becomes NULL in prepareJob if unchanged
+        NSString *x264OptionExtra = [fDisplayX264PresetsAdditonalOptionsTextField stringValue];
+        NSString *h264Profile     = @""; // becomes NULL in prepareJob if unchanged
+        NSString *h264Level       = @""; // becomes NULL in prepareJob if unchanged
+        // we can't set "none" in the queue as libhb doesn't handle it
         if ([fX264TunePopUp indexOfSelectedItem] != 0)
-        {            // we check to see if fastdecode is checked and if so we append it to the tune as so...
-            if ([fX264FastDecodeCheck state] == NSOnState)
-            {
-                [queueFileJob setObject:[NSString stringWithFormat:@"%@,%@", [fX264TunePopUp titleOfSelectedItem], @"fastdecode"] forKey:@"x264Tune"];
-                
-                
-            }
-            else
+        {
+            x264Tune = [x264Tune stringByAppendingString: [fX264TunePopUp titleOfSelectedItem]];
+        }
+        if ([fX264FastDecodeCheck state])
+        {
+            if ([x264Tune length])
             {
-                [queueFileJob setObject:[NSString stringWithFormat:@"%@", [fX264TunePopUp titleOfSelectedItem]] forKey:@"x264Tune"];
-                
+                x264Tune = [x264Tune stringByAppendingString: @","];
             }
+            x264Tune = [x264Tune stringByAppendingString: @"fastdecode"];
         }
-    } 
-    
-    // Make sure we are not ignoring the setting, for Profile its "auto" but index 0
-    if ([fX264ProfilePopUp indexOfSelectedItem] != 0)
-    {
-        [queueFileJob setObject:[NSString stringWithFormat:@"%@", [fX264ProfilePopUp titleOfSelectedItem]] forKey:@"h264Profile"];
-    }
-    // Make sure we are not ignoring the setting, for Level its "auto" but index 0
-    if ([fX264LevelPopUp indexOfSelectedItem] != 0)
-    {
-        [queueFileJob setObject:[NSString stringWithFormat:@"%@", [fX264LevelPopUp titleOfSelectedItem]] forKey:@"h264Level"];
+        // we can't set "auto" in the queue as libhb doesn't handle it
+        if ([fX264ProfilePopUp indexOfSelectedItem] != 0)
+        {
+            h264Profile = [fX264ProfilePopUp titleOfSelectedItem];
+        }
+        // we can't set "auto" in the queue as libhb doesn't handle it
+        if ([fX264LevelPopUp indexOfSelectedItem] != 0)
+        {
+            h264Level = [fX264LevelPopUp titleOfSelectedItem];
+        }
+        [queueFileJob setObject: [NSNumber numberWithInt:0] forKey: @"x264UseAdvancedOptions"];
+        [queueFileJob setObject: x264Preset                 forKey: @"x264Preset"];
+        [queueFileJob setObject: x264Tune                   forKey: @"x264Tune"];
+        [queueFileJob setObject: x264OptionExtra            forKey: @"x264OptionExtra"];
+        [queueFileJob setObject: h264Profile                forKey: @"h264Profile"];
+        [queueFileJob setObject: h264Level                  forKey: @"h264Level"];
     }
-    [queueFileJob setObject:[NSString stringWithFormat:@"%@", [fDisplayX264PresetsAdditonalOptionsTextField stringValue]] forKey:@"x264AdditionalOptions"];
-    /* END x264 Preset, Tune, Profile, and Levels */
     
     /* x264 Advanced Option String */
        [queueFileJob setObject:[fAdvancedOptions optionsString] forKey:@"x264Option"];
@@ -2891,25 +2901,41 @@ fWorkingCount = 0;
     /*
      * If scanning we need to do some extra setup of the job.
      */
-    if( job->indepth_scan == 1 )
+    if (job->indepth_scan == 1)
     {
-        NSString *advanced_opts_tmp = [NSString stringWithUTF8String: job->advanced_opts];
-        
+        char *x264_preset_tmp  = strdup(job->x264_preset);
+        char *x264_tune_tmp    = strdup(job->x264_tune);
+        char *x264_encopts_tmp = strdup(job->advanced_opts);
+        char *h264_profile_tmp = strdup(job->x264_profile);
+        char *h264_level_tmp   = strdup(job->h264_level);
         /*
          * When subtitle scan is enabled do a fast pre-scan job
          * which will determine which subtitles to enable, if any.
          */
-        job->pass = -1;
+        job->indepth_scan = 1;
+        job->pass         = -1;
+        hb_job_set_x264_preset  (job, NULL);
+        hb_job_set_x264_tune    (job, NULL);
         hb_job_set_advanced_opts(job, NULL);
-        
-        job->indepth_scan = 1;  
-
-        
+        hb_job_set_x264_profile (job, NULL);
+        hb_job_set_x264_level   (job, NULL);
         /*
-         * Add the pre-scan job
+         * add the pre-scan job
          */
-        hb_add( fQueueEncodeLibhb, job );
-        hb_job_set_advanced_opts(job, [advanced_opts_tmp UTF8String] );
+        hb_add(fQueueEncodeLibhb, job);
+        /*
+         * reset the advanced settings
+         */
+        hb_job_set_x264_preset  (job, x264_preset_tmp);
+        hb_job_set_x264_tune    (job, x264_tune_tmp);
+        hb_job_set_advanced_opts(job, x264_encopts_tmp);
+        hb_job_set_x264_profile (job, h264_profile_tmp);
+        hb_job_set_x264_level   (job, h264_level_tmp);
+        free(x264_preset_tmp);
+        free(x264_tune_tmp);
+        free(x264_encopts_tmp);
+        free(h264_profile_tmp);
+        free(h264_level_tmp);
     }
 
     
@@ -3262,32 +3288,63 @@ fWorkingCount = 0;
     /* Format (Muxer) and Video Encoder */
     job->mux = [[fDstFormatPopUp selectedItem] tag];
     job->vcodec = [[fVidEncoderPopUp selectedItem] tag];
+    job->fastfirstpass = 0;
 
     job->chapter_markers = 0;
     
        if( job->vcodec == HB_VCODEC_X264 )
     {
-               
-               /* Below Sends x264 options to the core library if x264 is selected*/
-               job->fastfirstpass = 0;
-        
-        // we are none on the x264 preset slider so use the advanced options panel
-        //if ([fX264PresetsSlider intValue] == 0)
+        /* advanced x264 options */
+        NSString   *x264Tune     = @"";
+        const char *x264_preset  = NULL;
+        const char *x264_tune    = NULL;
+        const char *x264_encopts = NULL;
+        const char *h264_profile = NULL;
+        const char *h264_level   = NULL;
         if ([fx264UseAdvancedOptionsCheck state])
         {
-            hb_job_set_advanced_opts(job, [[fAdvancedOptions optionsString] UTF8String] );
+            // we are using the advanced panel
+            x264_encopts = [[fAdvancedOptions optionsString] UTF8String];
         }
         else
         {
-            // we are using x264 presets
-            // so we set the presets, and tune etc according to the widgets
-            [self x264PresetsSetJobVariables:nil];
-            
+            // we are using the x264 system
+            x264_preset  = [[fX264PresetSelectedTextField stringValue] UTF8String];
+            x264_encopts = [[fDisplayX264PresetsAdditonalOptionsTextField stringValue] UTF8String];
+            if ([fX264TunePopUp indexOfSelectedItem] != 0)
+            {
+                x264Tune = [x264Tune stringByAppendingString: [fX264TunePopUp titleOfSelectedItem]];
+            }
+            if ([fX264FastDecodeCheck state])
+            {
+                if ([x264Tune length])
+                {
+                    x264Tune = [x264Tune stringByAppendingString: @","];
+                }
+                x264Tune = [x264Tune stringByAppendingString: @"fastdecode"];
+            }
+            if ([x264Tune length])
+            {
+                x264_tune = [x264Tune UTF8String];
+            }
+            if ([fX264ProfilePopUp indexOfSelectedItem] != 0)
+            {
+                h264_profile = [[fX264ProfilePopUp titleOfSelectedItem] UTF8String];
+            }
+            if ([fX264LevelPopUp indexOfSelectedItem] != 0)
+            {
+                h264_level = [[fX264ProfilePopUp titleOfSelectedItem] UTF8String];
+            }
         }
+        hb_job_set_x264_preset  (job, x264_preset);
+        hb_job_set_x264_tune    (job, x264_tune);
+        hb_job_set_advanced_opts(job, x264_encopts);
+        hb_job_set_x264_profile (job, h264_profile);
+        hb_job_set_x264_level   (job, h264_level);
     }
     else if( job->vcodec & HB_VCODEC_FFMPEG_MASK )
     {
-        hb_job_set_advanced_opts(job, [[fAdvancedOptions optionsStringLavc] UTF8String] );
+        hb_job_set_advanced_opts(job, [[fAdvancedOptions optionsStringLavc] UTF8String]);
     }
 
     /* Video settings */
@@ -3776,21 +3833,40 @@ bool one_burned = FALSE;
                        job->fastfirstpass = 0;
                }
         
-        /* Here we pass the x264 preset, profile, tune, level to libhb or the advanced string */
-        // First make sure we are not on the first tickmark for preset which does not use x264 presets
-        if([queueToApply objectForKey:@"x264Preset"])
+        /* Here we pass the advanced x264 options to libhb */
+        const char *x264_preset  = NULL;
+        const char *x264_tune    = NULL;
+        const char *x264_encopts = NULL;
+        const char *h264_profile = NULL;
+        const char *h264_level   = NULL;
+        if ([[queueToApply objectForKey:@"x264UseAdvancedOptions"] intValue])
         {
-            hb_job_set_x264_preset(job, [[queueToApply objectForKey:@"x264Preset"]UTF8String] );
-            // Note we do not have to append fast decode here to tune because it was already done in preparing the queue file item
-            hb_job_set_x264_tune (job, [[queueToApply objectForKey:@"x264Tune"]UTF8String] );
-            hb_job_set_x264_profile(job, [[queueToApply objectForKey:@"x264Profile"]UTF8String] );
-            hb_job_set_x264_level(job, [[queueToApply objectForKey:@"x264Level"]UTF8String] );
-            hb_job_set_advanced_opts( job, [[queueToApply objectForKey:@"x264AdditionalOptions"] UTF8String] );
+            // we are using the advanced panel
+            x264_encopts = [[queueToApply objectForKey:@"x264Option"] UTF8String];
         }
         else
         {
-            hb_job_set_advanced_opts( job, [[queueToApply objectForKey:@"x264Option"] UTF8String] );
+            // we are using the x264 system
+            x264_preset  = [[queueToApply objectForKey:@"x264Preset"] UTF8String];
+            x264_encopts = [[queueToApply objectForKey:@"x264OptionExtra"] UTF8String];
+            if ([[queueToApply objectForKey:@"x264Tune"] length])
+            {
+                x264_tune = [[queueToApply objectForKey:@"x264Tune"] UTF8String];
+            }
+            if ([[queueToApply objectForKey:@"h264Profile"] length])
+            {
+                h264_profile = [[queueToApply objectForKey:@"h264Profile"] UTF8String];
+            }
+            if ([[queueToApply objectForKey:@"h264Level"] length])
+            {
+                h264_level = [[queueToApply objectForKey:@"h264Level"] UTF8String];
+            }
         }
+        hb_job_set_x264_preset  (job, x264_preset);
+        hb_job_set_x264_tune    (job, x264_tune);
+        hb_job_set_advanced_opts(job, x264_encopts);
+        hb_job_set_x264_profile (job, h264_profile);
+        hb_job_set_x264_level   (job, h264_level);
     }
     else if( job->vcodec & HB_VCODEC_FFMPEG_MASK )
     {
@@ -5429,47 +5505,6 @@ the user is using "Custom" settings by determining the sender*/
     
 }
 
-
-- (IBAction) x264PresetsSetJobVariables: (id) sender
-
-{
-
-        hb_list_t  * list  = hb_get_titles( fHandle );
-        hb_title_t * title = (hb_title_t *) hb_list_item( list,
-                                                         [fSrcTitlePopUp indexOfSelectedItem] );
-        hb_job_t * job = title->job;
-        
-        hb_job_set_x264_preset(job, [[fX264PresetSelectedTextField stringValue]UTF8String] );
-        
-        // Make sure we are not ignoring the setting, for Tune its "none" but index 0
-        if ([fX264TunePopUp indexOfSelectedItem] != 0)
-        {
-            // we check to see if fastdecode is checked and if so we append it to the tune as so...
-            if ([fX264FastDecodeCheck state] == NSOnState)
-            {
-                hb_job_set_x264_tune (job,  [[NSString stringWithFormat:@"%@,%@", [fX264TunePopUp titleOfSelectedItem], @"fastdecode"] UTF8String] );
-                
-            }
-            else
-            {
-                hb_job_set_x264_tune (job, [[fX264TunePopUp titleOfSelectedItem]UTF8String] );   
-            }
-        }
-        // Make sure we are not ignoring the setting, for Profile its "auto" but index 0
-        if ([fX264ProfilePopUp indexOfSelectedItem] != 0)
-        {
-            hb_job_set_x264_profile(job, [[fX264ProfilePopUp titleOfSelectedItem]UTF8String] );
-        }
-        // Make sure we are not ignoring the setting, for Level its "auto" but index 0
-        if ([fX264LevelPopUp indexOfSelectedItem] != 0)
-        {
-            hb_job_set_x264_level(job, [[fX264LevelPopUp titleOfSelectedItem]UTF8String] );
-        }
-        
-        hb_job_set_advanced_opts(job, [[fDisplayX264PresetsAdditonalOptionsTextField stringValue] UTF8String] );
-        
-}
-
 #pragma mark -
 #pragma mark - Picture
 
@@ -6141,7 +6176,7 @@ return YES;
         if ([[chosenPreset objectForKey:@"VideoEncoder"] isEqualToString:@"H.264 (x264)"])
         {
             /*
-             * x264UeAdvancedOptions is not set (legacy preset)
+             * x264UseAdvancedOptions is not set (legacy preset)
              * or set to 1 (enabled), so we use the old advanced panel
              */
             if (![chosenPreset objectForKey:@"x264UseAdvancedOptions"] ||
@@ -6161,30 +6196,29 @@ return YES;
                 [self updateX264Widgets:nil];
             }
             /*
-             * x264UeAdvancedOptions is set to 0 (disabled),
+             * x264UseAdvancedOptions is set to 0 (disabled),
              * so we use the x264 system
              */
             else
             {
-                /* Set the x264 preset slider */
-                const char * const * x264_presets = hb_x264_presets();
-                for (int i = 0; x264_presets[i] != NULL; i++)
+                /* x264Preset */
+                NSString *name;
+                [fX264PresetsSlider setIntegerValue:fX264MediumPresetIndex];
+                NSEnumerator *enumerator = [fX264PresetNames objectEnumerator];
+                NSString *x264Preset = [chosenPreset objectForKey:@"x264Preset"];
+                while ((name = (NSString *)[enumerator nextObject]))
                 {
-                    if ([[chosenPreset objectForKey:@"x264Preset"]
-                                    isEqualToString: [NSString stringWithUTF8String:x264_presets[i]]])
+                    if ([name isEqualToString:x264Preset])
                     {
-                        [fX264PresetsSlider setIntValue: i];
+                        [fX264PresetsSlider setIntegerValue:[fX264PresetNames indexOfObject:name]];
                         [self x264PresetsSliderChanged:nil];
+                        break;
                     }
                 }
                 /* x264Tune */
-                if (![[chosenPreset objectForKey:@"x264Tune"] isEqualToString: @""])
-                {
-                    [fX264TunePopUp selectItemWithTitle:[chosenPreset objectForKey:@"x264Tune"]];
-                }
-                else
+                [fX264TunePopUp selectItemWithTitle:[chosenPreset objectForKey:@"x264Tune"]];
+                if ([fX264TunePopUp indexOfSelectedItem] == -1)
                 {
-                    /* if the preset does not specify, use "none" */
                     [fX264TunePopUp selectItemAtIndex:0];
                 }
                 /* Fast Decode checkbox */
@@ -6192,23 +6226,15 @@ return YES;
                 /*  additional x264 options */
                 [fDisplayX264PresetsAdditonalOptionsTextField setStringValue:[chosenPreset objectForKey:@"x264OptionExtra"]];
                 /* h264Profile */
-                if (![[chosenPreset objectForKey:@"h264Profile"] isEqualToString: @""])
-                {
-                    [fX264ProfilePopUp selectItemWithTitle:[chosenPreset objectForKey:@"h264Profile"]];
-                }
-                else
+                [fX264ProfilePopUp selectItemWithTitle:[chosenPreset objectForKey:@"h264Profile"]];
+                if ([fX264ProfilePopUp indexOfSelectedItem] == -1)
                 {
-                    /* if the preset does not specify, use "auto" */
                     [fX264ProfilePopUp selectItemAtIndex:0];   
                 }
                 /* h264Level */
-                if (![[chosenPreset objectForKey:@"h264Level"] isEqualToString: @""])
-                {
-                    [fX264LevelPopUp selectItemWithTitle:[chosenPreset objectForKey:@"h264Level"]];
-                }
-                else
+                [fX264LevelPopUp selectItemWithTitle:[chosenPreset objectForKey:@"h264Level"]];
+                if ([fX264LevelPopUp indexOfSelectedItem] == -1)
                 {
-                    /* if the preset does not specify, use "auto" */
                     [fX264LevelPopUp selectItemAtIndex:0];   
                 }
                 /* we enable the advanced panel and update the widgets */
@@ -6830,26 +6856,16 @@ return YES;
             [preset setObject:[NSNumber numberWithInt:0] forKey:@"x264UseAdvancedOptions"];
             /* x264 preset */
             [preset setObject:[fX264PresetSelectedTextField stringValue] forKey:@"x264Preset"];
-            /* x264 psy tune, if not "none" */
-            if ([fX264TunePopUp indexOfSelectedItem] != 0)
-            {
-                [preset setObject: [fX264TunePopUp titleOfSelectedItem] forKey:@"x264Tune"];
-                
-            }
-            /* x264 fastdecode - can be set even if tune is "none" */
+            /* x264 psy tune */
+            [preset setObject: [fX264TunePopUp titleOfSelectedItem] forKey:@"x264Tune"];
+            /* x264 fastdecode */
             [preset setObject: [NSNumber numberWithInt:[fX264FastDecodeCheck state]] forKey:@"x264FastDecode"];
             /* additional x264 options */
             [preset setObject:[fDisplayX264PresetsAdditonalOptionsTextField stringValue] forKey:@"x264OptionExtra"];
-            /* h264Profile, if not "auto" */
-            if ([fX264ProfilePopUp indexOfSelectedItem] != 0)
-            {
-                [preset setObject:[fX264ProfilePopUp titleOfSelectedItem] forKey:@"h264Profile"];
-            }
+            /* h264Profile */
+            [preset setObject:[fX264ProfilePopUp titleOfSelectedItem] forKey:@"h264Profile"];
             /* h264 level, if not "auto" */
-            if ([fX264LevelPopUp indexOfSelectedItem] != 0)
-            {
-                [preset setObject:[fX264LevelPopUp titleOfSelectedItem] forKey:@"h264Level"];
-            }
+            [preset setObject:[fX264LevelPopUp titleOfSelectedItem] forKey:@"h264Level"];
             /*
              * bonus: set the unparsed options to make the preset compatible
              * with old HB versions
index b2f4c2100e9eb3acb659f9e56fc553486de2c9f0..2a961be6d104816d2ce61c29606ed87ff49c59c1 100644 (file)
@@ -1319,76 +1319,63 @@ return ![(HBQueueOutlineView*)outlineView isDragging];
         [finalString appendString: videoInfo withAttributes:detailAttr];
         [finalString appendString:@"\n" withAttributes:detailAttr];
         
-        // x264 options (for now either the x264 presets panel or the hb x264 advanced panel
         if ([[item objectForKey:@"VideoEncoder"] isEqualToString: @"H.264 (x264)"])
         {
-            // check to see if we are using a x264 preset, if so concatenate the display of presets, tunes , etc.
-            if ([item objectForKey:@"x264Preset"])
+            /* we are using x264 */
+            NSString *x264Info = @"";
+            if ([[item objectForKey:@"x264UseAdvancedOptions"] intValue])
             {
-                [finalString appendString: @"x264 Presets: " withAttributes:detailBoldAttr];
-                NSString * x264PresetsInfo = @"";
-                x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Preset:%@ - ",[item objectForKey:@"x264Preset"]]]; 
-                if ([item objectForKey:@"x264Tune"])
+                // we are using the old advanced panel
+                if ([item objectForKey:@"x264Option"] &&
+                    [[item objectForKey:@"x264Option"] length])
                 {
-                    x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Tune:%@ -  ",[item objectForKey:@"x264Tune"]]];   
+                    x264Info = [x264Info stringByAppendingString: [item objectForKey:@"x264Option"]];
                 }
                 else
                 {
-                 x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Tune:none - "]];   
+                    x264Info = [x264Info stringByAppendingString: @"default settings"];
                 }
-                if ([item objectForKey:@"x264Option"])
-                {
-                     x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Additional Options:%@ - ",[item objectForKey:@"x264AdditionalOptions"]]];   
-                }
-                if ([item objectForKey:@"h264Profile"])
-                {
-                    x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Profile:%@ - ",[item objectForKey:@"h264Profile"]]];   
-                }
-                else
-                {
-                    x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Profile:auto - "]];   
-                }
-                if ([item objectForKey:@"h264Level"])
+            }
+            else
+            {
+                // we are using the x264 system
+                x264Info = [x264Info stringByAppendingString: [NSString stringWithFormat:@"Preset: %@", [item objectForKey:@"x264Preset"]]];
+                if ([[item objectForKey:@"x264Tune"] length])
                 {
-                    x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Level:%@",[item objectForKey:@"h264Level"]]];   
+                    x264Info = [x264Info stringByAppendingString: [NSString stringWithFormat:@" - Tune: %@", [item objectForKey:@"x264Tune"]]];
                 }
-                else
+                if ([[item objectForKey:@"x264OptionExtra"] length])
                 {
-                    x264PresetsInfo = [x264PresetsInfo stringByAppendingString: [NSString stringWithFormat:@"Level:auto"]];   
+                    x264Info = [x264Info stringByAppendingString: [NSString stringWithFormat:@" - Options: %@", [item objectForKey:@"x264OptionExtra"]]];
                 }
-                
-                [finalString appendString: x264PresetsInfo withAttributes:detailAttr];
-                
-            }
-            else /// we are using the HB Advanced Panel
-            {
-                [finalString appendString: @"x264 Advanced Options: " withAttributes:detailBoldAttr];
-                if ([item objectForKey:@"x264Option"])
+                if ([[item objectForKey:@"h264Profile"] length])
                 {
-                    [finalString appendString: [item objectForKey:@"x264Option"] withAttributes:detailAttr];
+                    x264Info = [x264Info stringByAppendingString: [NSString stringWithFormat:@" - Profile: %@", [item objectForKey:@"h264Profile"]]];
                 }
-                else
+                if ([[item objectForKey:@"h264Level"] length])
                 {
-                    [finalString appendString: @"x264 defaults" withAttributes:detailAttr];   
+                    x264Info = [x264Info stringByAppendingString: [NSString stringWithFormat:@" - Level: %@", [item objectForKey:@"h264Level"]]];
                 }
-                
             }
-            
+            [finalString appendString: @"x264: " withAttributes:detailBoldAttr];
+            [finalString appendString: x264Info withAttributes:detailAttr];
             [finalString appendString:@"\n" withAttributes:detailAttr];
         }
-        
-        /*If we are not x264 and we are not Theora then we must be FFmpeg (lavc) */
         else if (![[item objectForKey:@"VideoEncoder"] isEqualToString: @"VP3 (Theora)"])
         {
-            [finalString appendString: @"FFmpeg (lavc) Options: " withAttributes:detailBoldAttr];
-            if ([item objectForKey:@"lavcOption"])
+            /* we are using libavcodec */
+            NSString *lavcInfo = @"";
+            if ([item objectForKey:@"lavcOption"] &&
+                [[item objectForKey:@"lavcOption"] length])
             {
-                [finalString appendString: [item objectForKey:@"lavcOption"] withAttributes:detailAttr];
+                lavcInfo = [lavcInfo stringByAppendingString: [item objectForKey:@"lavcOption"]];
             }
             else
             {
-                [finalString appendString: @"FFmpeg (lavc) defaults" withAttributes:detailAttr];   
+                lavcInfo = [lavcInfo stringByAppendingString: @"default settings"];
             }
+            [finalString appendString: @"ffmpeg: " withAttributes:detailBoldAttr];
+            [finalString appendString: lavcInfo withAttributes:detailAttr];
             [finalString appendString:@"\n" withAttributes:detailAttr];
         }