mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 21:35:44 +00:00
qtdemux: Add the function to get channels and sample rate for AAC
Add aac_get_channels and sample_rate function to get these value for AAC. https://bugzilla.gnome.org/show_bug.cgi?id=749110
This commit is contained in:
parent
e47ae99363
commit
84f436f122
1 changed files with 4 additions and 9 deletions
|
@ -12169,18 +12169,13 @@ gst_qtdemux_handle_esds (GstQTDemux * qtdemux, QtDemuxStream * stream,
|
|||
* wrong. */
|
||||
/* Only do so for basic setup without HE-AAC extension */
|
||||
if (data_ptr && data_len == 2) {
|
||||
guint channels, rateindex, rate;
|
||||
guint channels, rate;
|
||||
|
||||
/* FIXME: add gst_codec_utils_aac_get_{channels|sample_rate}()? */
|
||||
channels = (data_ptr[1] & 0x7f) >> 3;
|
||||
if (channels > 0 && channels < 7) {
|
||||
channels = gst_codec_utils_aac_get_channels (data_ptr, data_len);
|
||||
if (channels > 0)
|
||||
stream->n_channels = channels;
|
||||
} else if (channels == 7) {
|
||||
stream->n_channels = 8;
|
||||
}
|
||||
|
||||
rateindex = ((data_ptr[0] & 0x7) << 1) | ((data_ptr[1] & 0x80) >> 7);
|
||||
rate = gst_codec_utils_aac_get_sample_rate_from_index (rateindex);
|
||||
rate = gst_codec_utils_aac_get_sample_rate (data_ptr, data_len);
|
||||
if (rate > 0)
|
||||
stream->rate = rate;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue