[MOVED FROM GST-P-FARSIGHT] Skip non-keyframes before we get a keyframe
authorOlivier Crete <olivier.crete@collabora.co.uk>
Fri, 25 Jul 2008 19:48:33 +0000 (19:48 +0000)
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>
Tue, 3 Mar 2009 19:34:07 +0000 (14:34 -0500)
20080725194833-3e2dc-583df57c8ebce4b149a01768ed7d3737136a208f.gz

ext/mimic/gstmimdec.c

index 9e97a300613c6b27b383fcbeadc92d12b25d501e..cd679a5aa4cca855470b2b4f1bc265a32737977f 100644 (file)
@@ -212,6 +212,14 @@ gst_mimdec_chain (GstPad *pad, GstBuffer *in)
       GstEvent * event;
       gboolean result;
 
+      /* Check if its a keyframe, otherwise skip it */
+      if (GUINT32_FROM_LE(*((guint32 *) (frame_body + 12))) != 0) {
+        gst_adapter_flush (mimdec->adapter, mimdec->payload_size);
+        mimdec->have_header = FALSE;
+        res = GST_FLOW_OK;
+        goto out;
+      }
+
       mimdec->dec = mimic_open ();
       if (mimdec->dec == NULL) {
         GST_WARNING_OBJECT (mimdec, "mimic_open error\n");