mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
theoradec: fix frame leaks
This commit is contained in:
parent
d4b8778299
commit
03ef88d7da
1 changed files with 17 additions and 3 deletions
|
@ -59,6 +59,11 @@ GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
||||||
#define THEORA_DEF_TELEMETRY_QI 0
|
#define THEORA_DEF_TELEMETRY_QI 0
|
||||||
#define THEORA_DEF_TELEMETRY_BITS 0
|
#define THEORA_DEF_TELEMETRY_BITS 0
|
||||||
|
|
||||||
|
/* This was removed from the base class, this is used as a
|
||||||
|
temporary return to signal the need to call _drop_frame,
|
||||||
|
and does not leave theoraenc. */
|
||||||
|
#define GST_CUSTOM_FLOW_DROP GST_FLOW_CUSTOM_SUCCESS_1
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
@ -733,7 +738,7 @@ dropping:
|
||||||
dropping_qos:
|
dropping_qos:
|
||||||
{
|
{
|
||||||
GST_WARNING_OBJECT (dec, "dropping frame because of QoS");
|
GST_WARNING_OBJECT (dec, "dropping frame because of QoS");
|
||||||
return GST_VIDEO_DECODER_FLOW_NEED_DATA;
|
return GST_CUSTOM_FLOW_DROP;
|
||||||
}
|
}
|
||||||
decode_error:
|
decode_error:
|
||||||
{
|
{
|
||||||
|
@ -809,8 +814,17 @@ theora_dec_handle_frame (GstVideoDecoder * bdec, GstVideoCodecFrame * frame)
|
||||||
dec = GST_THEORA_DEC (bdec);
|
dec = GST_THEORA_DEC (bdec);
|
||||||
|
|
||||||
res = theora_dec_decode_buffer (dec, frame->input_buffer, frame);
|
res = theora_dec_decode_buffer (dec, frame->input_buffer, frame);
|
||||||
if (res == GST_FLOW_OK)
|
switch (res) {
|
||||||
res = gst_video_decoder_finish_frame (bdec, frame);
|
case GST_FLOW_OK:
|
||||||
|
res = gst_video_decoder_finish_frame (bdec, frame);
|
||||||
|
break;
|
||||||
|
case GST_CUSTOM_FLOW_DROP:
|
||||||
|
res = gst_video_decoder_drop_frame (bdec, frame);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gst_video_codec_frame_unref (frame);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue