tsdemux: Avoid throwing FLOW_ERROR on last PCR processing error
authorThibault Saunier <thibault.saunier@collabora.com>
Wed, 15 Feb 2012 13:32:17 +0000 (10:32 -0300)
committerThibault Saunier <thibault.saunier@collabora.com>
Wed, 15 Feb 2012 18:48:44 +0000 (15:48 -0300)
In the case of scanning last pcr, errors are not critical, so we keep
the stream flowing.

gst/mpegtsdemux/tsdemux.c

index 7049c81..0fd86f9 100644 (file)
@@ -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;