diff options
author | jstebbins <jstebbins.hb@gmail.com> | 2012-04-26 19:11:03 +0000 |
---|---|---|
committer | jstebbins <jstebbins.hb@gmail.com> | 2012-04-26 19:11:03 +0000 |
commit | 143f723b12881a8ab3732386785a00840bb2c934 (patch) | |
tree | c1bfd505f424c241a34ed5f90e474efac637c4fc /macosx/HBSubtitles.m | |
parent | 3f9828657ded40e2eabfef8f01fa2182a4eccd36 (diff) |
PGS (bluray) subtitle support \o/
Thanks to patches supplied by David Mitchell and Rob McMullen
we finally have PGS support.
I added a fix for libav pgs timestamp processing and
detection of forced subtitles to their work, then
made foreign audio search work with PGS subs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4605 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBSubtitles.m')
-rw-r--r-- | macosx/HBSubtitles.m | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m index 1d0c45ae6..f84749303 100644 --- a/macosx/HBSubtitles.m +++ b/macosx/HBSubtitles.m @@ -3,18 +3,10 @@ This file is part of the HandBrake source code. Homepage: <http://handbrake.fr/>. It may be used under the terms of the GNU General Public License. */ -// #import "HBSubtitles.h" #include "hb.h" - - - - - - - @implementation HBSubtitles - (id)init { @@ -285,8 +277,8 @@ subtitle = (hb_subtitle_t *) hb_list_item( fTitle->list_subtitle, i ); sub_config = subtitle->config; - int canBeBurnedIn = subtitle->source == VOBSUB || subtitle->source == SSASUB; - int supportsForcedFlags = subtitle->source == VOBSUB; + int canBeBurnedIn = hb_subtitle_can_burn( subtitle->source ); + int supportsForcedFlags = hb_subtitle_can_force( subtitle->source ); /* create a dictionary of source subtitle information to store in our array */ NSMutableDictionary *newSubtitleSourceTrack = [[NSMutableDictionary alloc] init]; @@ -294,7 +286,7 @@ [newSubtitleSourceTrack setObject:[NSNumber numberWithInt:i] forKey:@"sourceTrackNum"]; /* Human-readable representation of subtitle->source */ NSString *subSourceName = [NSString stringWithUTF8String:hb_subsource_name( subtitle->source )]; - NSString *bitmapOrText = subtitle->source == PICTURESUB ? @"Bitmap" : @"Text"; + NSString *bitmapOrText = subtitle->format == PICTURESUB ? @"Bitmap" : @"Text"; /* Subtitle Source track name */ NSString *popupName = [NSString stringWithFormat:@"%d - %@ - (%@) (%@)",i,[NSString stringWithUTF8String:subtitle->lang],bitmapOrText,subSourceName]; [newSubtitleSourceTrack setObject:popupName forKey:@"sourceTrackName"]; @@ -769,7 +761,9 @@ */ if (container == HB_MUX_MP4 && [anObject intValue] != 0) { - if ([[[subtitleArray objectAtIndex:rowIndex] objectForKey:@"subtitleSourceTrackType"] isEqualToString:[NSString stringWithUTF8String:hb_subsource_name( VOBSUB )]]) + NSString *subtitleSourceTrackType = [[subtitleArray objectAtIndex:rowIndex] objectForKey:@"subtitleSourceTrackType"]; + if ([subtitleSourceTrackType isEqualToString:[NSString stringWithUTF8String:hb_subsource_name( VOBSUB )]] || + [subtitleSourceTrackType isEqualToString:[NSString stringWithUTF8String:hb_subsource_name( PGSSUB )]]) { /* lets see if there are currently any burned in subs specified */ NSEnumerator *enumerator = [subtitleArray objectEnumerator]; @@ -783,7 +777,7 @@ } } /* if we have no current vobsub set to burn it in ... burn it in by default */ - if(!subtrackBurnedInFound) + if (!subtrackBurnedInFound) { [[subtitleArray objectAtIndex:rowIndex] setObject:[NSNumber numberWithInt:1] forKey:@"subtitleTrackBurned"]; /* Burned In and Default are mutually exclusive */ |