mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +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;
|
||||
|
||||
dframe = g_slice_new0 (GstFFMpegVidDecVideoFrame);
|
||||
dframe->frame = gst_video_codec_frame_ref (frame);
|
||||
dframe->frame = frame;
|
||||
|
||||
return dframe;
|
||||
}
|
||||
|
@ -564,11 +564,9 @@ gst_ffmpegviddec_get_buffer (AVCodecContext * context, AVFrame * picture)
|
|||
if (G_UNLIKELY (frame == NULL))
|
||||
goto no_frame;
|
||||
|
||||
/* GstFFMpegVidDecVideoFrame receives the frame ref */
|
||||
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;
|
||||
|
||||
/* see if we need renegotiation */
|
||||
|
|
Loading…
Reference in a new issue