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)) {
|
||||
|
|
|
@ -25,7 +25,7 @@ gst_core_media_meta_free (GstCoreMediaMeta * meta, GstBuffer * buf)
|
|||
if (meta->image_buf != NULL) {
|
||||
CVPixelBufferUnlockBaseAddress (meta->image_buf,
|
||||
kCVPixelBufferLock_ReadOnly);
|
||||
CVBufferRelease(meta->image_buf);
|
||||
CVBufferRelease (meta->image_buf);
|
||||
}
|
||||
if (meta->block_buf != NULL) {
|
||||
CFRelease (meta->block_buf);
|
||||
|
|
|
@ -75,7 +75,7 @@ void
|
|||
gst_vtutil_dict_set_boolean (CFMutableDictionaryRef dict, CFStringRef key,
|
||||
gboolean value)
|
||||
{
|
||||
CFDictionarySetValue (dict, key, value ? kCFBooleanTrue: kCFBooleanFalse);
|
||||
CFDictionarySetValue (dict, key, value ? kCFBooleanTrue : kCFBooleanFalse);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -91,7 +91,7 @@ gst_vtutil_dict_set_data (CFMutableDictionaryRef dict, CFStringRef key,
|
|||
|
||||
void
|
||||
gst_vtutil_dict_set_object (CFMutableDictionaryRef dict, CFStringRef key,
|
||||
CFTypeRef *value)
|
||||
CFTypeRef * value)
|
||||
{
|
||||
CFDictionarySetValue (dict, key, value);
|
||||
CFRelease (value);
|
||||
|
|
Loading…
Reference in a new issue