]> granicus.if.org Git - handbrake/commit
sync: don't delay subtitles when duration is known
authorJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 15 Dec 2016 23:09:45 +0000 (15:09 -0800)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 15 Dec 2016 23:18:55 +0000 (15:18 -0800)
commit7d5ad09f3e9ae0352cb14e35cdbf37c66f9c5e78
tree71e65263d201e350ad3b4d2653db464a2011b7c5
parent7e8119993caafec4cfa8aa5805bf5b23c6ce0195
sync: don't delay subtitles when duration is known

Delayed subtitles were causing incorrect muxing in mkv.  The mkv muxer
writes chunks where all samples should be relative to a chunk's base
timestamp.  When the subtitle is delayed long enough for a new chunk to
start before it gets muxed, the calculated offset to the chunk's base
time is negative (which is illegal).

Note that this is still a possibility with subtitles that must be
delayed (e.g. CC and VOBSUB) because the duration is not known until
the next subtitle's start time is known. The only fix for this would be
to add a special subtitle parsing pass that caches subtitle timestamps
before the main encoding pass is performed.
libhb/sync.c