[prev in list] [next in list] [prev in thread] [next in thread]
List: xine-devel
Subject: [xine-devel] [PATCH] demux_ts-resume_from_corrupted_pes
From: Christophe Thommeret <hftom () free ! fr>
Date: 2008-10-19 23:25:06
Message-ID: 200810200125.07123.hftom () free ! fr
[Download RAW message or body]
- Fix resuming video after corrupted pes.
Without this patch, the video freezes.
Available corrupted sample:
http://hftom.free.fr/video_samples/corrupted_video.m2t
--
Christophe Thommeret
["demux_ts-resume_from_corrupted_pes.diff" (text/x-diff)]
diff -r f98dfc2d6b7a src/demuxers/demux_ts.c
--- a/src/demuxers/demux_ts.c Thu Oct 02 17:31:31 2008 +0200
+++ b/src/demuxers/demux_ts.c Sun Oct 19 17:23:19 2008 +0200
@@ -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
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
} 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 (demu
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++) {
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
xine-devel mailing list
xine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic