From e7460d9c0610eb4c233eb27c582d6a1d6ef78f32 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Tue, 26 Jan 2016 18:50:38 +0100 Subject: [PATCH] matroskamux: use A_AAC instead of A_AAC/MPEGx/y Some GoogleCast compatible devices ignore A_AAC/MPEGx/y tracks; Also according to http://wiki.multimedia.cx/index.php?title=Matroska A_AAC/MPEGx/y is obsolete https://bugzilla.gnome.org/show_bug.cgi?id=761144 --- gst/matroska/matroska-mux.c | 51 +++++---------------------------------------- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index 399ba4e..9dad18b 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -1687,42 +1687,6 @@ wrong_content_type: } } -static const gchar * -aac_codec_data_to_codec_id (GstBuffer * buf) -{ - const gchar *result; - guint8 profile; - - /* default to MAIN */ - profile = 1; - - if (gst_buffer_get_size (buf) >= 2) { - gst_buffer_extract (buf, 0, &profile, 1); - profile >>= 3; - } - - switch (profile) { - case 1: - result = "MAIN"; - break; - case 2: - result = "LC"; - break; - case 3: - result = "SSR"; - break; - case 4: - result = "LTP"; - break; - default: - GST_WARNING ("unknown AAC profile, defaulting to MAIN"); - result = "MAIN"; - break; - } - - return result; -} - /** * gst_matroska_mux_audio_pad_setcaps: * @pad: Pad which got the caps. @@ -1840,16 +1804,11 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps) } if (buf) { - if (mpegversion == 2) - context->codec_id = - g_strdup_printf (GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG2 "%s", - aac_codec_data_to_codec_id (buf)); - else if (mpegversion == 4) - context->codec_id = - g_strdup_printf (GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG4 "%s", - aac_codec_data_to_codec_id (buf)); - else - g_assert_not_reached (); + context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_AAC); + context->codec_priv_size = gst_buffer_get_size (buf); + context->codec_priv = g_malloc (context->codec_priv_size); + gst_buffer_extract (buf, 0, context->codec_priv, + context->codec_priv_size); } else { GST_DEBUG_OBJECT (mux, "no AAC codec_data; not packetized"); goto refuse_caps; -- 2.7.4