summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-11-06 16:38:00 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-08 18:05:11 +0200
commit47ba682a636e3741530ebe956bbd6a508aa56a83 (patch)
tree64accc4e08be22d9e64dfe9a19b5fc94fbf736a3 /libmpdemux
parentc739ab299264a08c6838712b2745e4c9d7613eca (diff)
downloadmpv-47ba682a636e3741530ebe956bbd6a508aa56a83.tar.bz2
mpv-47ba682a636e3741530ebe956bbd6a508aa56a83.tar.xz
demux_ts: Fix subtitle sync issues
Ensure we queue all subtitle packets before demuxing the next video packet. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32587 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_ts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c
index 643a00075c..30c063695d 100644
--- a/libmpdemux/demux_ts.c
+++ b/libmpdemux/demux_ts.c
@@ -2965,6 +2965,11 @@ static int ts_parse(demuxer_t *demuxer , ES_stream_t *es, unsigned char *packet,
//IS IT TIME TO QUEUE DATA to the dp_packet?
if(is_start && (dp != NULL))
{
+ // subtitle packets _have_ to be submitted before video, otherwise
+ // they might get stuck "forever" and subtitles will be completely
+ // out of sync.
+ if (is_video)
+ fill_packet(demuxer, demuxer->sub, &priv->fifo[2].pack, &priv->fifo[2].offset, NULL);
retv = fill_packet(demuxer, ds, dp, dp_offset, si);
}