mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
theoraenc: Don't leak incoming frames (and buffers)
We get given a reference in ::handle_frame(), remove it when we're done.
This commit is contained in:
parent
4ce453de97
commit
a4eda89b3c
1 changed files with 6 additions and 5 deletions
|
@ -993,27 +993,28 @@ theora_enc_handle_frame (GstVideoEncoder * benc, GstVideoCodecFrame * frame)
|
||||||
while (th_encode_packetout (enc->encoder, 0, &op)) {
|
while (th_encode_packetout (enc->encoder, 0, &op)) {
|
||||||
ret = theora_push_packet (enc, &op);
|
ret = theora_push_packet (enc, &op);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
goto data_push;
|
goto beach;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beach:
|
||||||
|
gst_video_codec_frame_unref (frame);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
multipass_read_failed:
|
multipass_read_failed:
|
||||||
{
|
{
|
||||||
|
gst_video_codec_frame_unref (frame);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
multipass_write_failed:
|
multipass_write_failed:
|
||||||
{
|
{
|
||||||
return ret;
|
gst_video_codec_frame_unref (frame);
|
||||||
}
|
|
||||||
data_push:
|
|
||||||
{
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
encoder_disabled:
|
encoder_disabled:
|
||||||
{
|
{
|
||||||
|
gst_video_codec_frame_unref (frame);
|
||||||
GST_ELEMENT_ERROR (enc, STREAM, ENCODE, (NULL),
|
GST_ELEMENT_ERROR (enc, STREAM, ENCODE, (NULL),
|
||||||
("libtheora has been compiled with the encoder disabled"));
|
("libtheora has been compiled with the encoder disabled"));
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue