diff options
author | Benjamin Otte <otte@gnome.org> | 2003-11-04 22:31:05 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2003-11-04 22:31:05 +0000 |
commit | 4e9bb8eb6c5ae329b62adaf37e76837965b39955 (patch) | |
tree | 0749b6f701c17bf3f177be824fe3ca5da97c2974 | |
parent | 7e8b50efaa6eb0da27bf7a7e605df88c8313efd1 (diff) | |
download | gst-libav-4e9bb8eb6c5ae329b62adaf37e76837965b39955.tar.gz |
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
-rw-r--r-- | ext/ffmpeg/gstffmpegcodecmap.c | 32 | ||||
-rw-r--r-- | 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 2644655..a82ed41 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 181c25d..b9bc317 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); |