From ade430c70fc0e00443fcdb635722c85cc6691bfb Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Thu, 2 Apr 2015 17:50:00 +0200 Subject: demux_ts: Another safety against freeze on heavy seeking. VDPAU seems not to need this nasty workaround (and it seems not to be harmed by it either). Doing this inside ff_video_decoder would affect all demuxers, and only for MPEG-TS I am halfway sure that there will follow another sequence header after seek. Alternatively, demux_ts could seek to keyframes. This is not as simple as it sounds. Many DVB streams I have seen only show "Auxillary data" and "Sequence extended info" NAL units openly. All the rest hides behind escapes... --- src/demuxers/demux_ts.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 890b8e12e..a9883963c 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -2536,6 +2536,12 @@ static int demux_ts_seek (demux_plugin_t *this_gen, this->buf_flag_seek = 1; _x_demux_flush_engine(this->stream); + /* Append sequence end code to video stream. */ + /* Keep ffmpeg h.264 video decoder from piling up too many DR1 frames, */ + /* and thus freezing video out. */ + if (this->videoPid != INVALID_PID && this->stream->video_fifo) + post_sequence_end (this->stream->video_fifo, this->media[this->videoMedia].type); + } demux_ts_tbre_reset (this); -- cgit v1.2.3