codecs: h264: Do not ignore end_picture() return value
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 18 Mar 2020 20:51:11 +0000 (16:51 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 31 Mar 2020 13:34:05 +0000 (09:34 -0400)
If decoding failed because end_picture() failed, set the picture to
nonexisting, this way output_picture() will be skipped. This avoids confusing
special cases in output_picture() implementation.

gst-libs/gst/codecs/gsth264decoder.c

index 91aefd3..456b8fd 100644 (file)
@@ -1133,8 +1133,10 @@ gst_h264_decoder_finish_current_picture (GstH264Decoder * self)
 
   klass = GST_H264_DECODER_GET_CLASS (self);
 
-  if (klass->end_picture)
-    ret = klass->end_picture (self, priv->current_picture);
+  if (klass->end_picture) {
+    if (!klass->end_picture (self, priv->current_picture))
+      priv->current_picture->nonexisting = TRUE;
+  }
 
   /* finish picture takes ownership of the picture */
   ret = gst_h264_decoder_finish_picture (self, priv->current_picture);