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
This commit is contained in:
Benjamin Otte 2003-11-04 22:31:05 +00:00
parent 7e8b50efaa
commit 4e9bb8eb6c
2 changed files with 21 additions and 22 deletions

View file

@ -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:

View file

@ -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);