mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
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:
parent
7e8b50efaa
commit
4e9bb8eb6c
2 changed files with 21 additions and 22 deletions
|
@ -111,31 +111,31 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CODEC_ID_MP2:
|
case CODEC_ID_MP2:
|
||||||
caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_mp2",
|
caps = GST_CAPS_NEW ("ffmpeg_mp2",
|
||||||
"audio/mpeg",
|
"audio/mpeg",
|
||||||
"layer", GST_PROPS_INT (2)
|
"layer", GST_PROPS_INT (2)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CODEC_ID_MP3LAME:
|
case CODEC_ID_MP3LAME:
|
||||||
caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_mp3",
|
caps = GST_CAPS_NEW ("ffmpeg_mp3",
|
||||||
"audio/mpeg",
|
"audio/mpeg",
|
||||||
"layer", GST_PROPS_INT (3)
|
"layer", GST_PROPS_INT (3)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CODEC_ID_VORBIS: /* FIXME? vorbis or ogg? */
|
case CODEC_ID_VORBIS: /* FIXME? vorbis or ogg? */
|
||||||
caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_vorbis",
|
caps = GST_CAPS_NEW ("ffmpeg_vorbis",
|
||||||
"application/ogg",
|
"application/ogg",
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CODEC_ID_AC3:
|
case CODEC_ID_AC3:
|
||||||
caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_ac3",
|
caps = GST_CAPS_NEW ("ffmpeg_ac3",
|
||||||
"audio/x-ac3",
|
"audio/x-ac3",
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CODEC_ID_MJPEG:
|
case CODEC_ID_MJPEG:
|
||||||
|
|
|
@ -163,7 +163,7 @@ gst_ffmpegdec_class_init (GstFFMpegDecClass *klass)
|
||||||
gobject_class = (GObjectClass*)klass;
|
gobject_class = (GObjectClass*)klass;
|
||||||
gstelement_class = (GstElementClass*)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;
|
gobject_class->dispose = gst_ffmpegdec_dispose;
|
||||||
gstelement_class->change_state = gst_ffmpegdec_change_state;
|
gstelement_class->change_state = gst_ffmpegdec_change_state;
|
||||||
|
@ -194,11 +194,10 @@ static void
|
||||||
gst_ffmpegdec_dispose (GObject *object)
|
gst_ffmpegdec_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) object;
|
GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) object;
|
||||||
/* close old session */
|
|
||||||
if (ffmpegdec->opened) {
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||||
avcodec_close (ffmpegdec->context);
|
/* old session should have been closed in element_class->dispose */
|
||||||
ffmpegdec->opened = FALSE;
|
g_assert (!ffmpegdec->opened);
|
||||||
}
|
|
||||||
|
|
||||||
/* clean up remaining allocated data */
|
/* clean up remaining allocated data */
|
||||||
av_free (ffmpegdec->context);
|
av_free (ffmpegdec->context);
|
||||||
|
|
Loading…
Reference in a new issue