Revert "avviddec: Fix memory leaks and assertions in error cases if we can't allocate a frame"

This reverts commit 47647e1cac.

Breaks playback when direct rendering is disabled.
The reason is that we set the opaque vaue to NULL and then try to use the NULL
value when we decoded a frame.
This commit is contained in:
Wim Taymans 2012-12-11 10:22:34 +01:00
parent 4fc452344a
commit 76b8b8c67f

View file

@ -485,7 +485,7 @@ static int
gst_ffmpegviddec_get_buffer (AVCodecContext * context, AVFrame * picture)
{
GstVideoCodecFrame *frame;
GstFFMpegVidDecVideoFrame *dframe = NULL;
GstFFMpegVidDecVideoFrame *dframe;
GstFFMpegVidDec *ffmpegdec;
gint c;
GstVideoInfo *info;
@ -583,10 +583,6 @@ invalid_frame:
}
fallback:
{
if (dframe)
gst_ffmpegviddec_video_frame_free (dframe);
picture->opaque = NULL;
return avcodec_default_get_buffer (context, picture);
}
duplicate_frame:
@ -673,8 +669,7 @@ gst_ffmpegviddec_release_buffer (AVCodecContext * context, AVFrame * picture)
/* we remove the opaque data now */
picture->opaque = NULL;
if (frame)
gst_ffmpegviddec_video_frame_free (frame);
gst_ffmpegviddec_video_frame_free (frame);
/* zero out the reference in ffmpeg */
for (i = 0; i < 4; i++) {