ext/ffmpeg/gstffmpegdec.c: Finalizing a decoder that was never used shouldn't trigger an assertion.

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_finalize),
(gst_ffmpegdec_get_buffer), (gst_ffmpegdec_frame):
Finalizing a decoder that was never used shouldn't trigger an assertion.
Add debug messages for the two other g_assert_if_reached().
This commit is contained in:
Edward Hervey 2008-08-29 09:59:29 +00:00
parent 459ba46c22
commit d16582feb6
2 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2008-08-29 Edward Hervey <edward.hervey@collabora.co.uk>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_finalize),
(gst_ffmpegdec_get_buffer), (gst_ffmpegdec_frame):
Finalizing a decoder that was never used shouldn't trigger an assertion.
Add debug messages for the two other g_assert_if_reached().
2008-08-29 Edward Hervey <edward.hervey@collabora.co.uk>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_aud_caps_new):

View file

@ -358,12 +358,13 @@ gst_ffmpegdec_finalize (GObject * object)
{
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) object;
g_assert (!ffmpegdec->opened);
/* clean up remaining allocated data */
av_free (ffmpegdec->context);
av_free (ffmpegdec->picture);
if (ffmpegdec->opened) {
/* clean up remaining allocated data */
av_free (ffmpegdec->context);
av_free (ffmpegdec->picture);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@ -862,6 +863,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture)
}
case CODEC_TYPE_AUDIO:
default:
GST_ERROR_OBJECT (ffmpegdec, "_get_buffer() should never get called for non-video buffers !");
g_assert_not_reached ();
break;
}
@ -1856,6 +1858,7 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
in_duration, &outbuf, ret);
break;
default:
GST_ERROR_OBJECT (ffmpegdec, "Asked to decode non-audio/video frame !");
g_assert_not_reached ();
break;
}