mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
atdec: Set correct number of frames for MP3
This commit is contained in:
parent
2d8b195911
commit
1c13e513c9
3 changed files with 9 additions and 4 deletions
|
@ -225,22 +225,27 @@ gst_caps_to_at_format (GstCaps * caps, AudioStreamBasicDescription * format)
|
|||
format->mFormatID = kAudioFormatMPEG4AAC;
|
||||
format->mFramesPerPacket = 1024;
|
||||
} else if (can_intersect_static_caps (caps, &mp3_caps)) {
|
||||
gint layer;
|
||||
gint layer, mpegaudioversion = 1;
|
||||
|
||||
gst_structure_get_int (structure, "layer", &layer);
|
||||
gst_structure_get_int (structure, "mpegaudioversion", &mpegaudioversion);
|
||||
switch (layer) {
|
||||
case 1:
|
||||
format->mFormatID = kAudioFormatMPEGLayer1;
|
||||
format->mFramesPerPacket = 384;
|
||||
break;
|
||||
case 2:
|
||||
format->mFormatID = kAudioFormatMPEGLayer2;
|
||||
format->mFramesPerPacket = 1152;
|
||||
break;
|
||||
case 3:
|
||||
format->mFormatID = kAudioFormatMPEGLayer3;
|
||||
format->mFramesPerPacket = (mpegaudioversion == 1 ? 1152 : 576);
|
||||
break;
|
||||
default:
|
||||
g_warn_if_reached ();
|
||||
format->mFormatID = kAudioFormatMPEGLayer3;
|
||||
format->mFramesPerPacket = 1152;
|
||||
break;
|
||||
}
|
||||
} else if (can_intersect_static_caps (caps, &raw_caps)) {
|
||||
|
|
Loading…
Reference in a new issue