summaryrefslogtreecommitdiff
path: root/gst-libs/gst/codecs/gsth265decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/codecs/gsth265decoder.c')
-rw-r--r--gst-libs/gst/codecs/gsth265decoder.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gst-libs/gst/codecs/gsth265decoder.c b/gst-libs/gst/codecs/gsth265decoder.c
index dc8240fc5..7b33349a3 100644
--- a/gst-libs/gst/codecs/gsth265decoder.c
+++ b/gst-libs/gst/codecs/gsth265decoder.c
@@ -1750,8 +1750,13 @@ gst_h265_decoder_handle_frame (GstVideoDecoder * decoder,
return priv->last_ret;
}
- gst_h265_decoder_finish_current_picture (self);
- gst_video_codec_frame_unref (frame);
+ if (priv->current_picture) {
+ gst_h265_decoder_finish_current_picture (self);
+ gst_video_codec_frame_unref (frame);
+ } else {
+ /* This picture was dropped */
+ gst_video_decoder_release_frame (decoder, frame);
+ }
return priv->last_ret;
}