]> granicus.if.org Git - handbrake/commitdiff
MacGui: Fix subtitle issues
authordynaflash <dynaflashtech@gmail.com>
Mon, 15 Jun 2009 16:39:54 +0000 (16:39 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Mon, 15 Jun 2009 16:39:54 +0000 (16:39 +0000)
- fix crash if only closed captions are selected (thanks van).
- set RENDERSUB when burned is selected for foreign audio search (thanks j45)

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

macosx/Controller.mm

index da04ca25ac91096893139024bcdb7bee7e72df23..25fe20c56a1924379b023c037ca5ab40eed6b876 100644 (file)
@@ -2836,12 +2836,6 @@ bool one_burned = FALSE;
          */
         if (subtitle > 0)
         {
-            hb_subtitle_t * subt;
-            hb_subtitle_config_t sub_config;
-            
-            subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle);
-            sub_config = subt->config;
-            
             /* if i is 0, then we are in the first item of the subtitles which we need to 
              * check for the "Foreign Audio Search" which would be subtitleSourceTrackNum of 1
              * bearing in mind that for all tracks subtitleSourceTrackNum of 0 is None.
@@ -2892,14 +2886,14 @@ bool one_burned = FALSE;
                 
                 /* We are setting a source subtitle so access the source subtitle info */  
                 hb_subtitle_t * subt;
-                hb_subtitle_config_t sub_config;
                 
                 subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle);
-                sub_config = subt->config;
                 
                 if (subt != NULL)
                 {
                     [self writeToActivityLog: "Setting Subtitle: %s", subt];
+
+                    hb_subtitle_config_t sub_config = subt->config;
                     
                     if (!burned && job->mux == HB_MUX_MKV && 
                         subt->format == hb_subtitle_s::PICTURESUB)
@@ -3359,12 +3353,6 @@ bool one_burned = FALSE;
          */
         if (subtitle > 0)
         {
-            hb_subtitle_t * subt;
-            hb_subtitle_config_t sub_config;
-            
-            subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle);
-            sub_config = subt->config;
-            
             /* if i is 0, then we are in the first item of the subtitles which we need to 
              * check for the "Foreign Audio Search" which would be subtitleSourceTrackNum of 1
              * bearing in mind that for all tracks subtitleSourceTrackNum of 0 is None.
@@ -3382,6 +3370,10 @@ bool one_burned = FALSE;
                     {
                         job->select_subtitle_config.dest = hb_subtitle_config_s::PASSTHRUSUB;
                     }
+                    else
+                    {
+                        job->select_subtitle_config.dest = hb_subtitle_config_s::RENDERSUB;
+                    }
                     
                     job->select_subtitle_config.force = force;
                     job->select_subtitle_config.default_track = def;
@@ -3410,14 +3402,14 @@ bool one_burned = FALSE;
                 
                 /* We are setting a source subtitle so access the source subtitle info */  
                 hb_subtitle_t * subt;
-                hb_subtitle_config_t sub_config;
                 
                 subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle);
-                sub_config = subt->config;
                 
                 if (subt != NULL)
                 {
                     [self writeToActivityLog: "Setting Subtitle: %s", subt];
+
+                    hb_subtitle_config_t sub_config = subt->config;
                     
                     if (!burned && job->mux == HB_MUX_MKV && 
                         subt->format == hb_subtitle_s::PICTURESUB)