decodebin: only try to expose complete groups
authorThiago Santos <thiagoss@osg.samsung.com>
Tue, 14 Jul 2015 03:03:10 +0000 (00:03 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Tue, 14 Jul 2015 03:11:59 +0000 (00:11 -0300)
When switching to a new chain it might be that this new chain
is not yet ready to be exposed so check it before exposing.

Can happen with mpegts that might delay adding pads or pushing data
until it has found the PMT/PAT/PCR and that may take a while depending
on the stream.

It happened frequently with HLS:
http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/appleman.m3u8

gst/playback/gstdecodebin2.c

index 6f72dd34e997b3ee5f735458b14f654470267560..cc36c9f383ea040ab3513fad42140e74a0e0a6af 100644 (file)
@@ -4352,8 +4352,12 @@ retry:
             &drained, &switched);
         GST_ELEMENT_WARNING (dbin, STREAM, FAILED, (NULL),
             ("all streams without buffers"));
-        if (switched)
-          goto retry;
+        if (switched) {
+          if (gst_decode_chain_is_complete (dbin->decode_chain))
+            goto retry;
+          else
+            return FALSE;
+        }
       }
     }