diff options
author | Rodeo <[email protected]> | 2012-05-10 22:30:18 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-05-10 22:30:18 +0000 |
commit | ea44e3d23deb066758e8caff32d99346e7a9e9b9 (patch) | |
tree | d4336ad7c1be23dec5b20ffb1cc856c4f1f55ae9 /libhb/muxmkv.c | |
parent | 4fb04896b1fb8ddebdf2440ce361732151e6dfd6 (diff) |
libhb: PGS subtitle improvements.
Some devices (such as the WD TV Live) expect PGS subtitle "frames" to come as a single packet, whereas on Blu-ray, each frame "segment" comes in its own packet. When doing PGS passthrough, merge packets so that 1 subtitle == 1 packet.
This matches what MakeMKV amd mkvmerge do.
Also, when doing forced-only extraction, don't include more 'empty' PGS subtitles than necessary.
In muxmkv, cleanup negative subtitle durations (doesn't appear to fix anything, but it doesn't make anything worse either).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4658 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmkv.c')
-rw-r--r-- | libhb/muxmkv.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c index 227159579..b1927ff80 100644 --- a/libhb/muxmkv.c +++ b/libhb/muxmkv.c @@ -473,17 +473,19 @@ static int MKVMux( hb_mux_object_t * m, hb_mux_data_t * mux_data, return 0; } } - else if ( mux_data->subtitle ) + else if (mux_data->subtitle) { - uint64_t duration; - timecode = buf->s.start * TIMECODE_SCALE; if( mk_startFrame(m->file, mux_data->track) < 0) { hb_error( "Failed to write frame to output file, Disk Full?" ); *job->die = 1; } - + uint64_t duration; + timecode = buf->s.start * TIMECODE_SCALE; duration = buf->s.stop * TIMECODE_SCALE - timecode; + // PGS subtitles have negative durations (buf->s.start - 0) + if (duration < 0) + duration = 0; mk_addFrameData(m->file, mux_data->track, buf->data, buf->size); mk_setFrameFlags(m->file, mux_data->track, timecode, 1, duration); mk_flushFrame(m->file, mux_data->track); |