diff options
author | Christophe Thommeret <hftom@free.fr> | 2008-11-07 17:12:03 +0000 |
---|---|---|
committer | Christophe Thommeret <hftom@free.fr> | 2008-11-07 17:12:03 +0000 |
commit | a1a7416f7c6cac2dd7d5b7262e3b494dd2c451d3 (patch) | |
tree | 4d262ee0c1391baea8ee250e5ed56a2be10923a7 /src | |
parent | 2c5aa1b2a0964a6df110d3cad0946b0870c62c0c (diff) | |
download | xine-lib-a1a7416f7c6cac2dd7d5b7262e3b494dd2c451d3.tar.gz xine-lib-a1a7416f7c6cac2dd7d5b7262e3b494dd2c451d3.tar.bz2 |
Fix resuming video after corrupted pes.
Without this patch, the video freezes.
Available corrupted sample:
http://hftom.free.fr/video_samples/corrupted_video.m2t
--HG--
extra : transplant_source : %86g%9A%B1%AF%12L%7E%3EN%8C%0FT%D2%D8%3B%7Dv%F0%14
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_ts.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 6c2adc67f..55e06c033 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -249,6 +249,7 @@ typedef struct { int64_t packet_count; int corrupted_pes; uint32_t buffered_bytes; + int autodetected; } demux_ts_media; @@ -932,9 +933,11 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts, m->buf->free_buffer(m->buf); m->buf = NULL; - if (m->corrupted_pes > CORRUPT_PES_THRESHOLD) { - if (this->videoPid == m->pid) + if (m->corrupted_pes > CORRUPT_PES_THRESHOLD && m->autodetected) { + if (this->videoPid == m->pid) { this->videoPid = INVALID_PID; + this->last_pmt_crc = 0; + } } else { m->corrupted_pes++; xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, @@ -1855,6 +1858,7 @@ static void demux_ts_parse_packet (demux_ts_t*this) { } else if (!found) { this->videoPid = pid; this->videoMedia = this->media_num; + this->media[this->videoMedia].autodetected = 1; demux_ts_pes_new(this, this->media_num++, pid, this->video_fifo, 0x100 + pes_stream_id); } @@ -2269,6 +2273,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, for (i = 0; i < MAX_PIDS; i++) { this->media[i].pid = INVALID_PID; this->media[i].buf = NULL; + this->media[i].autodetected = 0; } for (i = 0; i < MAX_PMTS; i++) { |