mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
mpegtsmux: fix creation of ADTS header for AAC audio in MPEG-TS
https://bugzilla.gnome.org/show_bug.cgi?id=695412
This commit is contained in:
parent
175498434c
commit
72c5c70b90
1 changed files with 3 additions and 4 deletions
|
@ -108,9 +108,8 @@ mpegtsmux_prepare_aac (GstBuffer * buf, MpegTsPadData * data, MpegTsMux * mux)
|
||||||
gst_buffer_map (data->codec_data, &codec_data_map, GST_MAP_READ);
|
gst_buffer_map (data->codec_data, &codec_data_map, GST_MAP_READ);
|
||||||
|
|
||||||
/* Generate ADTS header */
|
/* Generate ADTS header */
|
||||||
obj_type = (GST_READ_UINT8 (codec_data_map.data) & 0xC) >> 2;
|
obj_type = GST_READ_UINT8 (codec_data_map.data) >> 3;
|
||||||
obj_type++;
|
rate_idx = (GST_READ_UINT8 (codec_data_map.data) & 0x7) << 1;
|
||||||
rate_idx = (GST_READ_UINT8 (codec_data_map.data) & 0x3) << 1;
|
|
||||||
rate_idx |= (GST_READ_UINT8 (codec_data_map.data + 1) & 0x80) >> 7;
|
rate_idx |= (GST_READ_UINT8 (codec_data_map.data + 1) & 0x80) >> 7;
|
||||||
channels = (GST_READ_UINT8 (codec_data_map.data + 1) & 0x78) >> 3;
|
channels = (GST_READ_UINT8 (codec_data_map.data + 1) & 0x78) >> 3;
|
||||||
GST_DEBUG_OBJECT (mux, "Rate index %u, channels %u, object type %u", rate_idx,
|
GST_DEBUG_OBJECT (mux, "Rate index %u, channels %u, object type %u", rate_idx,
|
||||||
|
@ -121,7 +120,7 @@ mpegtsmux_prepare_aac (GstBuffer * buf, MpegTsPadData * data, MpegTsMux * mux)
|
||||||
* (ID, layer, protection)*/
|
* (ID, layer, protection)*/
|
||||||
adts_header[1] = 0xF1;
|
adts_header[1] = 0xF1;
|
||||||
/* Object type over first 2 bits */
|
/* Object type over first 2 bits */
|
||||||
adts_header[2] = obj_type << 6;
|
adts_header[2] = (obj_type - 1) << 6;
|
||||||
/* rate index over next 4 bits */
|
/* rate index over next 4 bits */
|
||||||
adts_header[2] |= (rate_idx << 2);
|
adts_header[2] |= (rate_idx << 2);
|
||||||
/* channels over last 2 bits */
|
/* channels over last 2 bits */
|
||||||
|
|
Loading…
Reference in a new issue