mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
flvdemux: Use aac codec-data to adjust channels if needed
Flv does not support various channels in AAC stream format, for example flvdemux detect an audio channels of 2(stereo) when the AAC really is 1(mono). https://bugzilla.gnome.org/show_bug.cgi?id=797275
This commit is contained in:
parent
7b5f7249e8
commit
bd6a4aa10d
1 changed files with 12 additions and 1 deletions
|
@ -723,6 +723,7 @@ gst_flv_demux_audio_negotiate (GstFlvDemux * demux, guint32 codec_tag,
|
|||
GstCaps *caps = NULL, *old_caps;
|
||||
gboolean ret = FALSE;
|
||||
guint adjusted_rate = rate;
|
||||
guint adjusted_channels = channels;
|
||||
GstEvent *event;
|
||||
gchar *stream_id;
|
||||
|
||||
|
@ -784,6 +785,16 @@ gst_flv_demux_audio_negotiate (GstFlvDemux * demux, guint32 codec_tag,
|
|||
} else {
|
||||
adjusted_rate = rate;
|
||||
}
|
||||
|
||||
adjusted_channels =
|
||||
gst_codec_utils_aac_get_channels (map.data, map.size);
|
||||
|
||||
if (adjusted_channels && (channels != adjusted_channels)) {
|
||||
GST_LOG_OBJECT (demux, "Ajusting AAC channels %d -> %d", channels,
|
||||
adjusted_channels);
|
||||
} else {
|
||||
adjusted_channels = channels;
|
||||
}
|
||||
}
|
||||
gst_buffer_unmap (demux->audio_codec_data, &map);
|
||||
|
||||
|
@ -866,7 +877,7 @@ gst_flv_demux_audio_negotiate (GstFlvDemux * demux, guint32 codec_tag,
|
|||
}
|
||||
|
||||
gst_caps_set_simple (caps, "rate", G_TYPE_INT, adjusted_rate,
|
||||
"channels", G_TYPE_INT, channels, NULL);
|
||||
"channels", G_TYPE_INT, adjusted_channels, NULL);
|
||||
|
||||
if (demux->audio_codec_data) {
|
||||
gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER,
|
||||
|
|
Loading…
Reference in a new issue