From 4e9bb8eb6c5ae329b62adaf37e76837965b39955 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 4 Nov 2003 22:31:05 +0000 Subject: [PATCH] random fixes to ffmpeg: decoding of mp3 now works, call parent_class->dispose Original commit message from CVS: random fixes to ffmpeg: decoding of mp3 now works, call parent_class->dispose --- ext/ffmpeg/gstffmpegcodecmap.c | 32 ++++++++++++++++---------------- ext/ffmpeg/gstffmpegdec.c | 11 +++++------ 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 2644655670..a82ed412df 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -111,31 +111,31 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, break; case CODEC_ID_MP2: - caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_mp2", - "audio/mpeg", - "layer", GST_PROPS_INT (2) - ); + caps = GST_CAPS_NEW ("ffmpeg_mp2", + "audio/mpeg", + "layer", GST_PROPS_INT (2) + ); break; case CODEC_ID_MP3LAME: - caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_mp3", - "audio/mpeg", - "layer", GST_PROPS_INT (3) - ); + caps = GST_CAPS_NEW ("ffmpeg_mp3", + "audio/mpeg", + "layer", GST_PROPS_INT (3) + ); break; case CODEC_ID_VORBIS: /* FIXME? vorbis or ogg? */ - caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_vorbis", - "application/ogg", - NULL - ); + caps = GST_CAPS_NEW ("ffmpeg_vorbis", + "application/ogg", + NULL + ); break; case CODEC_ID_AC3: - caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_ac3", - "audio/x-ac3", - NULL - ); + caps = GST_CAPS_NEW ("ffmpeg_ac3", + "audio/x-ac3", + NULL + ); break; case CODEC_ID_MJPEG: diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 181c25dd12..b9bc317b2c 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -163,7 +163,7 @@ gst_ffmpegdec_class_init (GstFFMpegDecClass *klass) gobject_class = (GObjectClass*)klass; gstelement_class = (GstElementClass*)klass; - parent_class = g_type_class_ref(GST_TYPE_ELEMENT); + parent_class = g_type_class_peek_parent (klass); gobject_class->dispose = gst_ffmpegdec_dispose; gstelement_class->change_state = gst_ffmpegdec_change_state; @@ -194,11 +194,10 @@ static void gst_ffmpegdec_dispose (GObject *object) { GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) object; - /* close old session */ - if (ffmpegdec->opened) { - avcodec_close (ffmpegdec->context); - ffmpegdec->opened = FALSE; - } + + G_OBJECT_CLASS (parent_class)->dispose (object); + /* old session should have been closed in element_class->dispose */ + g_assert (!ffmpegdec->opened); /* clean up remaining allocated data */ av_free (ffmpegdec->context);