From: Rodeo Date: Sun, 12 May 2013 21:49:54 +0000 (+0000) Subject: MacGui: stop before the last ("None") subtitle track when converting incompatible... X-Git-Tag: 0.9.9~2^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54548c1b81b719aba1810b9b21526fced9a675ce;p=handbrake MacGui: stop before the last ("None") subtitle track when converting incompatible tracks to burn-in. 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 --- diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m index 94561a983..d8b4b6989 100644 --- a/macosx/HBSubtitles.m +++ b/macosx/HBSubtitles.m @@ -1009,8 +1009,9 @@ 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)) @@ -1032,7 +1033,8 @@ 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))