From bd7db134126b1ff10193979be0233ceb952d2dcc Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 18 Mar 2020 16:51:11 -0400 Subject: [PATCH] codecs: h264: Do not ignore end_picture() return value 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c index 91aefd3019..456b8fd182 100644 --- a/gst-libs/gst/codecs/gsth264decoder.c +++ b/gst-libs/gst/codecs/gsth264decoder.c @@ -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);