From 3357ddb0e17bf347505b6099796971e0b49481ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 15 Dec 2016 14:05:09 +0200 Subject: [PATCH] amcaudiodec: Set "is-adts" to 1 for ADTS AAC Otherwise it fails to decode. https://bugzilla.gnome.org/show_bug.cgi?id=740101 --- sys/androidmedia/gstamcaudiodec.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c index 49c8c602cb..f46df7b095 100644 --- a/sys/androidmedia/gstamcaudiodec.c +++ b/sys/androidmedia/gstamcaudiodec.c @@ -882,6 +882,21 @@ gst_amc_audio_dec_set_format (GstAudioDecoder * decoder, GstCaps * caps) return FALSE; } + if (gst_structure_has_name (s, "audio/mpeg")) { + gint mpegversion; + const gchar *stream_format; + + if (!gst_structure_get_int (s, "mpegversion", &mpegversion)) + mpegversion = -1; + stream_format = gst_structure_get_string (s, "stream-format"); + + if (mpegversion == 4 && g_strcmp0 (stream_format, "adts") == 0) { + gst_amc_format_set_int (format, "is-adts", 1, &err); + if (err) + GST_ELEMENT_WARNING_FROM_ERROR (self, err); + } + } + /* FIXME: These buffers needs to be valid until the codec is stopped again */ g_list_foreach (self->codec_datas, (GFunc) gst_buffer_unref, NULL); g_list_free (self->codec_datas);