summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-01-20 10:02:48 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-01-20 10:02:48 +0200
commit7eee775d5f3ee705abd7805838cd48cab1f6870a (patch)
tree78fd86c84c4bf0eed7c03a4aa88f59bf5592a40d /ext
parent01f995b8ddc4f86e12ff32788ecd902c930129b5 (diff)
downloadgstreamer-plugins-good-7eee775d5f3ee705abd7805838cd48cab1f6870a.tar.gz
vpxdec: Unref frame in all code paths of handle_frame()
https://bugzilla.gnome.org/show_bug.cgi?id=760666
Diffstat (limited to 'ext')
-rw-r--r--ext/vpx/gstvpxdec.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/vpx/gstvpxdec.c b/ext/vpx/gstvpxdec.c
index 1d2ddca84..d955ef09a 100644
--- a/ext/vpx/gstvpxdec.c
+++ b/ext/vpx/gstvpxdec.c
@@ -564,12 +564,10 @@ gst_vpx_dec_open_codec (GstVPXDec * dec, GstVideoCodecFrame * frame)
if (status != VPX_CODEC_OK) {
GST_WARNING_OBJECT (dec, "VPX preprocessing error: %s",
gst_vpx_error_name (status));
- gst_video_decoder_drop_frame (GST_VIDEO_DECODER (dec), frame);
return GST_FLOW_CUSTOM_SUCCESS_1;
}
if (!stream_info.is_kf) {
GST_WARNING_OBJECT (dec, "No keyframe, skipping");
- gst_video_decoder_drop_frame (GST_VIDEO_DECODER (dec), frame);
return GST_FLOW_CUSTOM_SUCCESS_1;
}
@@ -644,10 +642,13 @@ gst_vpx_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
if (!dec->decoder_inited) {
ret = vpxclass->open_codec (dec, frame);
- if (ret == GST_FLOW_CUSTOM_SUCCESS_1)
+ if (ret == GST_FLOW_CUSTOM_SUCCESS_1) {
+ gst_video_decoder_drop_frame (decoder, frame);
return GST_FLOW_OK;
- else if (ret != GST_FLOW_OK)
+ } else if (ret != GST_FLOW_OK) {
+ gst_video_codec_frame_unref (frame);
return ret;
+ }
}
deadline = gst_video_decoder_get_max_decode_time (decoder, frame);
@@ -661,6 +662,7 @@ gst_vpx_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
if (!gst_buffer_map (frame->input_buffer, &minfo, GST_MAP_READ)) {
GST_ERROR_OBJECT (dec, "Failed to map input buffer");
+ gst_video_codec_frame_unref (frame);
return GST_FLOW_ERROR;
}
@@ -672,6 +674,7 @@ gst_vpx_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
if (status) {
GST_VIDEO_DECODER_ERROR (decoder, 1, LIBRARY, ENCODE,
("Failed to decode frame"), ("%s", gst_vpx_error_name (status)), ret);
+ gst_video_codec_frame_unref (frame);
return ret;
}
@@ -682,6 +685,7 @@ gst_vpx_dec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
GST_ELEMENT_ERROR (decoder, LIBRARY, ENCODE,
("Failed to decode frame"), ("Unsupported color format %d",
img->fmt));
+ gst_video_codec_frame_unref (frame);
return GST_FLOW_ERROR;
}