mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
avdec: avoid some refs
We can let the ffmpeg structure take ownership of the buffer.
This commit is contained in:
parent
3ff6f53f24
commit
41ad632275
1 changed files with 2 additions and 4 deletions
|
@ -523,7 +523,7 @@ gst_ffmpegviddec_video_frame_new (GstVideoCodecFrame * frame)
|
||||||
GstFFMpegVidDecVideoFrame *dframe;
|
GstFFMpegVidDecVideoFrame *dframe;
|
||||||
|
|
||||||
dframe = g_slice_new0 (GstFFMpegVidDecVideoFrame);
|
dframe = g_slice_new0 (GstFFMpegVidDecVideoFrame);
|
||||||
dframe->frame = gst_video_codec_frame_ref (frame);
|
dframe->frame = frame;
|
||||||
|
|
||||||
return dframe;
|
return dframe;
|
||||||
}
|
}
|
||||||
|
@ -564,11 +564,9 @@ gst_ffmpegviddec_get_buffer (AVCodecContext * context, AVFrame * picture)
|
||||||
if (G_UNLIKELY (frame == NULL))
|
if (G_UNLIKELY (frame == NULL))
|
||||||
goto no_frame;
|
goto no_frame;
|
||||||
|
|
||||||
|
/* GstFFMpegVidDecVideoFrame receives the frame ref */
|
||||||
picture->opaque = dframe = gst_ffmpegviddec_video_frame_new (frame);
|
picture->opaque = dframe = gst_ffmpegviddec_video_frame_new (frame);
|
||||||
|
|
||||||
/* ffmpegviddec_video_frame will keep the frame retained */
|
|
||||||
gst_video_codec_frame_unref (frame);
|
|
||||||
|
|
||||||
ffmpegdec->context->pix_fmt = context->pix_fmt;
|
ffmpegdec->context->pix_fmt = context->pix_fmt;
|
||||||
|
|
||||||
/* see if we need renegotiation */
|
/* see if we need renegotiation */
|
||||||
|
|
Loading…
Reference in a new issue