summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2023-05-06 04:14:49 +0900
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-09 23:19:39 +0000
commit43461432ec1af623d2b6f58693868023d9bf7288 (patch)
treece94c55ff87d071a589cfb84e543557771dfebf0
parentb9f7ab60526af50fb2810e1bba19b0c511b9d52e (diff)
downloadgstreamer-43461432ec1af623d2b6f58693868023d9bf7288.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4586>
-rw-r--r--subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c14
1 files changed, 10 insertions, 4 deletions
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 86a45aa193..fc7d3a1ce5 100644
--- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c
+++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c
@@ -1792,10 +1792,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);