summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2010-02-16 12:40:16 +0000
committerphintuka <phintuka>2010-02-16 12:40:16 +0000
commit4bbdbfe3e91644636d2bdd2dba1a1a80f74111cf (patch)
tree289fa42cb1e70c5dec046507c41c00db6ece589a
parentc216879d7213dbc13e6f0993fd2ca3ab51544085 (diff)
downloadxineliboutput-4bbdbfe3e91644636d2bdd2dba1a1a80f74111cf.tar.gz
xineliboutput-4bbdbfe3e91644636d2bdd2dba1a1a80f74111cf.tar.bz2
Drop broken PES packets
-rw-r--r--xine/ts2es.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/xine/ts2es.c b/xine/ts2es.c
index 6476ad4d..736dd105 100644
--- a/xine/ts2es.c
+++ b/xine/ts2es.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: ts2es.c,v 1.7 2010-02-16 12:38:43 phintuka Exp $
+ * $Id: ts2es.c,v 1.8 2010-02-16 12:40:16 phintuka Exp $
*
*/
@@ -31,15 +31,18 @@ struct ts2es_s {
int pes_start;
int first_pusi_seen;
int video;
+ int pes_error;
};
static void ts2es_parse_pes(ts2es_t *this)
{
if (!DATA_IS_PES(this->buf->content)) {
- LOGMSG("ts2es: payload not PES ?");
+ LOGDBG("ts2es: payload not PES ?");
+ this->pes_error = 1;
return;
}
+ this->pes_error = 0;
/* parse PES header */
uint hdr_len = PES_HEADER_LEN(this->buf->content);
@@ -142,6 +145,16 @@ buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data, fifo_buffer_t *src_fifo)
return NULL;
}
+ /* drop broken PES packets */
+ if (this->pes_error && !pusi) {
+ if (this->buf) {
+ LOGDBG("ts2es: dropping broken PES packet");
+ this->buf->free_buffer(this->buf);
+ this->buf = NULL;
+ }
+ return NULL;
+ }
+
/* handle new payload unit */
if (pusi) {
this->first_pusi_seen = 1;