From 1182dd0c1ba3e97d197d145dcdb0feeb76f6cd1e Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 15 Feb 2012 10:32:17 -0300 Subject: [PATCH] tsdemux: Avoid throwing FLOW_ERROR on last PCR processing error In the case of scanning last pcr, errors are not critical, so we keep the stream flowing. --- gst/mpegtsdemux/tsdemux.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 7049c816ed..0fd86f98f2 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1697,7 +1697,7 @@ process_pcr (MpegTSBase * base, guint64 initoff, TSPcrOffset * pcroffset, GstFlowReturn ret = GST_FLOW_OK; MpegTSBaseProgram *program; GstBuffer *buf; - guint nbpcr, i = 0; + guint i, nbpcr = 0; guint32 pcrmask, pcrpattern; guint64 pcrs[50]; guint64 pcroffs[50]; @@ -1708,8 +1708,12 @@ process_pcr (MpegTSBase * base, guint64 initoff, TSPcrOffset * pcroffset, /* Get the program */ program = demux->program; - if (G_UNLIKELY (program == NULL)) - return GST_FLOW_ERROR; + if (G_UNLIKELY (program == NULL)) { + GST_DEBUG ("No program set, can not keep processing pcr"); + + ret = GST_FLOW_ERROR; + goto beach; + } /* First find the first X PCR */ nbpcr = 0;