avdec: avoid some refs

We can let the ffmpeg structure take ownership of the buffer.
This commit is contained in:
Wim Taymans 2012-07-03 17:04:03 +02:00
parent 3ff6f53f24
commit 41ad632275

View file

@ -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 */