From 74b7493fd3e0f4387209a97fd048c7ea4df30939 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 6 May 2023 04:14:49 +0900 Subject: h264decoder: Drop nonexisting picture silently without error If end_picture() was not successful, we do drop corresponding GstVideoCodecFrame and therefore gst_video_decoder_get_frame() will return nullptr which is expected behavior. Part-of: --- .../gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'subprojects') diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c index 1711a8a484..07224fd9fc 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c @@ -1791,10 +1791,16 @@ gst_h264_decoder_do_output_picture (GstH264Decoder * self, picture->system_frame_number); if (!frame) { - GST_ERROR_OBJECT (self, - "No available codec frame with frame number %d", - picture->system_frame_number); - UPDATE_FLOW_RETURN (ret, GST_FLOW_ERROR); + /* The case where the end_picture() got failed and corresponding + * GstVideoCodecFrame was dropped already */ + if (picture->nonexisting) { + GST_DEBUG_OBJECT (self, "Dropping non-existing picture %p", picture); + } else { + GST_ERROR_OBJECT (self, + "No available codec frame with frame number %d", + picture->system_frame_number); + UPDATE_FLOW_RETURN (ret, GST_FLOW_ERROR); + } gst_h264_picture_unref (picture); -- cgit v1.2.1