]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/commitdiff
ducativc1dec: workaround to not abort decoding on broken frames
authorAlessandro Decina <alessandro.decina@collabora.co.uk>
Fri, 23 Dec 2011 12:14:16 +0000 (13:14 +0100)
committerAlessandro Decina <alessandro.decina@collabora.co.uk>
Fri, 23 Dec 2011 12:14:16 +0000 (13:14 +0100)
When on some broken frames the codec returns fatal error 0x00409000, pretend it
isn't fatal and just carry on as the codec seems to be able to continue
decoding subsequent valid frames correctly.

src/gstducativc1dec.c

index c4384f33319b15630376847c10ac3926fefbfd93..afd73430b2395605b7774543cf0574ae351a4e1d 100644 (file)
@@ -202,6 +202,22 @@ gst_ducati_vc1dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf)
   return NULL;
 }
 
+static gint
+gst_ducati_vc1dec_handle_error (GstDucatiVidDec * self, gint ret,
+    gint extended_error, gint status_extended_error)
+{
+  if (extended_error == 0x00409000)
+    /* the codec sets some IVC1DEC_ERR_PICHDR (corrupted picture headers) errors
+     * as fatal even though it's able to recover 
+     */
+    ret = XDM_EOK;
+  else
+    ret = parent_class->handle_error (self, ret, extended_error,
+        status_extended_error);
+
+  return ret;
+}
+
 /* GstElement vmethod implementations */
 
 static GstStateChangeReturn
@@ -270,6 +286,7 @@ gst_ducati_vc1dec_class_init (GstDucatiVC1DecClass * klass)
       GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_allocate_params);
   bclass->push_input =
       GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_push_input);
+  bclass->handle_error = GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_handle_error);
 }
 
 static void