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 17:02:48 +0000
commit74b7493fd3e0f4387209a97fd048c7ea4df30939 (patch)
tree7189b66a62ea31e7350d02e40b03ccdaa56547a0
parent6675ed9aaebd6e7b973bc09fb2aca5c01b829649 (diff)
downloadgstreamer-74b7493fd3e0f4387209a97fd048c7ea4df30939.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/4561>
-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 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);