[MPlayer-cvslog] r32864 - trunk/libmpdemux/demux_ts.c
reimar
subversion at mplayerhq.hu
Sun Feb 6 14:52:05 CET 2011
Author: reimar
Date: Sun Feb 6 14:52:05 2011
New Revision: 32864
Log:
Fix r32587: the previous approach to return subtitles in time broke
DVB subtitles due to returning incomplete packets and even for
PGS subtitles resulted in incorrect pts values for the sub packets.
Modified:
trunk/libmpdemux/demux_ts.c
Modified: trunk/libmpdemux/demux_ts.c
==============================================================================
--- trunk/libmpdemux/demux_ts.c Sun Feb 6 14:09:09 2011 (r32863)
+++ trunk/libmpdemux/demux_ts.c Sun Feb 6 14:52:05 2011 (r32864)
@@ -2985,11 +2985,6 @@ static int ts_parse(demuxer_t *demuxer ,
//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);
}
@@ -3130,6 +3125,9 @@ static int ts_parse(demuxer_t *demuxer ,
(*dp)->flags = 0;
(*dp)->pos = stream_tell(demuxer->stream);
(*dp)->pts = es->pts;
+ // subtitle packets must be returned immediately if possible
+ if (is_sub && !tss->payload_size)
+ retv = fill_packet(demuxer, ds, dp, dp_offset, si);
if(retv > 0)
return retv;
@@ -3171,7 +3169,8 @@ static int ts_parse(demuxer_t *demuxer ,
{
*dp_offset += sz;
- if(*dp_offset >= MAX_PACK_BYTES)
+ // subtitle packets must be returned immediately if possible
+ if(*dp_offset >= MAX_PACK_BYTES || (is_sub && !tss->payload_size))
{
(*dp)->pts = tss->last_pts;
retv = fill_packet(demuxer, ds, dp, dp_offset, si);
More information about the MPlayer-cvslog
mailing list