summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordynaflash <[email protected]>2010-05-26 16:51:40 +0000
committerdynaflash <[email protected]>2010-05-26 16:51:40 +0000
commit20cab56e705724cbab5a22f18bee3f53c35aa86e (patch)
tree8f829ecd249b4a6a879d5038c581c184c6445b8b
parentebb28e921481ce1642d5ed9f8ab0c45939b2df77 (diff)
Macgui: Sanity check multiple burned in vobsubs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3328 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/HBSubtitles.m24
1 files changed, 21 insertions, 3 deletions
diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m
index 027ff0108..aca6c023b 100644
--- a/macosx/HBSubtitles.m
+++ b/macosx/HBSubtitles.m
@@ -758,12 +758,30 @@
{
/* Since currently no quicktime based playback devices support soft vobsubs (bitmap) in mp4, we make sure
- * "burned in" is specified by default to avoid massive confusion and anarchy. */
+ * "burned in" is specified by default to avoid massive confusion and anarchy. However we also want to guard against
+ * multiple burned in subtitle tracks as libhb would ignore all but the first one anyway. Plus it would probably be
+ * stupid.
+ */
if (container == HB_MUX_MP4 && [anObject intValue] != 0)
{
if ([[[subtitleArray objectAtIndex:rowIndex] objectForKey:@"subtitleSourceTrackisPictureSub"] intValue] == 1)
{
- [[subtitleArray objectAtIndex:rowIndex] setObject:[NSNumber numberWithInt:1] forKey:@"subtitleTrackBurned"];
+ /* lets see if there are currently any burned in subs specified */
+ NSEnumerator *enumerator = [subtitleArray objectEnumerator];
+ id tempObject;
+ BOOL subtrackBurnedInFound = NO;
+ while ( tempObject = [enumerator nextObject] )
+ {
+ if ([[tempObject objectForKey:@"subtitleTrackBurned"] intValue] == 1)
+ {
+ subtrackBurnedInFound = YES;
+ }
+ }
+ /* if we have no current vobsub set to burn it in ... burn it in by default */
+ if(!subtrackBurnedInFound)
+ {
+ [[subtitleArray objectAtIndex:rowIndex] setObject:[NSNumber numberWithInt:1] forKey:@"subtitleTrackBurned"];
+ }
}
}
@@ -912,7 +930,7 @@
}
}
-
+
}