Commit 4ee3b353 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Sorry Dave... Add mpegversion=1 to mp3 caps everywhere so that the autoplugger...

Sorry Dave... Add mpegversion=1 to mp3 caps everywhere so that the autoplugger uses mad and not faad for mp3 decoding...

Original commit message from CVS:
Sorry Dave... Add mpegversion=1 to mp3 caps everywhere so that the autoplugger uses mad and not faad for mp3 decoding. This should fix mp3 playback.
parent 75c76000
......@@ -111,14 +111,16 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_MP2:
caps = GST_FF_AUD_CAPS_NEW ("ffmpeg_mp2",
"audio/mpeg",
"layer", GST_PROPS_INT (2)
"mpegversion", GST_PROPS_INT (1),
"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)
"mpegversion", GST_PROPS_INT (1),
"layer", GST_PROPS_INT (3)
);
break;
......@@ -1261,29 +1263,37 @@ gst_ffmpeg_caps_to_codecid (GstCaps *caps,
} else if (!strcmp(mimetype, "audio/mpeg")) {
if (gst_caps_has_property (caps, "layer")) {
gint layer = 0;
if (gst_caps_has_property (caps, "mpegversion")) {
gint mpegversion = 0;
gst_caps_get_int (caps, "layer", &layer);
switch (layer) {
case 1:
case 2:
id = CODEC_ID_MP2;
break;
case 3:
id = CODEC_ID_MP3LAME;
gst_caps_get_int (caps, "mpegversion", &mpegversion);
switch (mpegversion) {
case 2: /* ffmpeg uses faad for both... */
case 4:
id = CODEC_ID_MPEG4AAC;
break;
case 1:
if (gst_caps_has_property (caps, "layer")) {
gint layer = 0;
gst_caps_get_int (caps, "layer", &layer);
switch (layer) {
case 1:
case 2:
id = CODEC_ID_MP2;
break;
case 3:
id = CODEC_ID_MP3;
break;
default:
/* ... */
break;
}
}
default:
/* ... */
break;
}
} else if (gst_caps_has_property (caps, "mpegversion")) {
gint mpegversion = 0;
gst_caps_get_int (caps, "mpegversion", &mpegversion);
if (mpegversion == 4) {
id = CODEC_ID_MPEG4AAC;
}
}
if (id != CODEC_ID_NONE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment