summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2012-05-01 18:46:31 +0000
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-05-02 16:45:37 +0200
commitab63871be67e00f7198591d64f52982ffa563d5b (patch)
tree100515256c3a55b01c78456f0a0dc438c1bddc35
parentc03f8b116afdc8d0e19619bdfb31dde95bf057cd (diff)
mpeg2dec: Port to new way of handling frame reference
-rw-r--r--ext/mpeg2dec/gstmpeg2dec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c
index 63d1837b..120c5fd9 100644
--- a/ext/mpeg2dec/gstmpeg2dec.c
+++ b/ext/mpeg2dec/gstmpeg2dec.c
@@ -633,6 +633,7 @@ handle_picture (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info,
type_str = "B";
break;
default:
+ gst_video_codec_frame_ref (frame);
gst_video_decoder_drop_frame (GST_VIDEO_DECODER (mpeg2dec), frame);
GST_VIDEO_DECODER_ERROR (mpeg2dec, 1, STREAM, DECODE,
("decoding error"), ("Invalid picture type"), ret);
@@ -797,6 +798,7 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder,
if (ret == GST_FLOW_ERROR) {
GST_VIDEO_DECODER_ERROR (decoder, 1, STREAM, DECODE,
("decoding error"), ("Bad sequence header"), ret);
+ gst_video_decoder_drop_frame (decoder, frame);
gst_mpeg2dec_reset (decoder, 0);
goto done;
}
@@ -851,6 +853,7 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder,
default:
GST_ERROR_OBJECT (mpeg2dec, "Unknown libmpeg2 state %d, FIXME", state);
ret = GST_FLOW_OK;
+ gst_video_codec_frame_unref (frame);
goto done;
}
@@ -861,6 +864,8 @@ gst_mpeg2dec_handle_frame (GstVideoDecoder * decoder,
}
}
+ gst_video_codec_frame_unref (frame);
+
done:
return ret;
}