]> granicus.if.org Git - handbrake/commitdiff
MacGui: stop before the last ("None") subtitle track when converting incompatible...
authorRodeo <tdskywalker@gmail.com>
Sun, 12 May 2013 21:49:54 +0000 (21:49 +0000)
committerRodeo <tdskywalker@gmail.com>
Sun, 12 May 2013 21:49:54 +0000 (21:49 +0000)
We were calling [[tempObject objectForKey:@"subtitleSourceTrackType"] intValue], so for "None", [nil intValue], which was returning 0. As it turns out, VOBSUB == 0 thus hb_subtitle_can_pass() was true out of sheer luck.

In a case where e.g. hb_subtitle_can_pass(VOBSUB, mux) is false (such as with the upcoming HB_MUX_AV_MP4 muxer), the None track would actually be deleted!

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

macosx/HBSubtitles.m

index 94561a983fa8c37fd15a24da88c1c75ce6afe754..d8b4b6989f436e73af54b6a33b92933fb074c3b8 100644 (file)
         BOOL convertToBurnInUsed       = NO;
         NSMutableArray *tracksToDelete = [[NSMutableArray alloc] init];
         NSEnumerator *enumerator       = [subtitleArray objectEnumerator];
-        /* convert any incompatible tracks to burn-in or remove them */
-        while (tempObject = [enumerator nextObject])
+        /* convert any non-None incompatible tracks to burn-in or remove them */
+        while ((tempObject = [enumerator nextObject]) &&
+               [tempObject objectForKey:@"subtitleSourceTrackType"])
         {
             subtitleTrackType = [[tempObject objectForKey:@"subtitleSourceTrackType"] intValue];
             if (!hb_subtitle_can_pass(subtitleTrackType, container))
         if (convertToBurnInUsed == YES)
         {
             enumerator = [subtitleArray objectEnumerator];
-            while (tempObject = [enumerator nextObject])
+            while ((tempObject = [enumerator nextObject]) &&
+                   [tempObject objectForKey:@"subtitleSourceTrackType"])
             {
                 subtitleTrackType = [[tempObject objectForKey:@"subtitleSourceTrackType"] intValue];
                 if (hb_subtitle_can_pass(subtitleTrackType, container))