mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 18:48:44 +00:00
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.
This commit is contained in:
parent
75c76000f1
commit
4ee3b353e9
1 changed files with 31 additions and 21 deletions
|
@ -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,28 +1263,36 @@ gst_ffmpeg_caps_to_codecid (GstCaps *caps,
|
|||
|
||||
} else if (!strcmp(mimetype, "audio/mpeg")) {
|
||||
|
||||
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_MP3LAME;
|
||||
break;
|
||||
default:
|
||||
/* ... */
|
||||
break;
|
||||
}
|
||||
} else if (gst_caps_has_property (caps, "mpegversion")) {
|
||||
if (gst_caps_has_property (caps, "mpegversion")) {
|
||||
gint mpegversion = 0;
|
||||
|
||||
gst_caps_get_int (caps, "mpegversion", &mpegversion);
|
||||
if (mpegversion == 4) {
|
||||
id = CODEC_ID_MPEG4AAC;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue