[Bug 678078] [ffdec_aac_latm] Fails to decode when channels/rate are specified

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Jul 4 03:09:08 PDT 2012


https://bugzilla.gnome.org/show_bug.cgi?id=678078
  GStreamer | gst-plugins-bad | git

--- Comment #5 from Tvrtko Ursulin <tvrtko.ursulin at onelan.co.uk> 2012-07-04 10:09:07 UTC ---
(From update of attachment 217999)
>diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c
>index 57f5aff..acc22e2 100644
>--- a/gst/audioparsers/gstaacparse.c
>+++ b/gst/audioparsers/gstaacparse.c
>@@ -114,6 +114,19 @@ gst_aac_parse_get_sample_rate_from_index (guint sr_idx)
>   return 0;
> }
> 
>+static inline gint
>+gst_aac_parse_get_channels_from_index (guint ch_idx)
>+{
>+  if (ch_idx == 0 || ch_idx > 7)
>+    GST_WARNING ("Unsupported channel configuration %u", ch_idx);
>+  else if (ch_idx == 7)
>+    return 8;
>+  else
>+    return ch_idx;
>+  
>+  return 0;
>+}
>+
> /**
>  * gst_aac_parse_base_init:
>  * @klass: #GstElementClass.
>@@ -679,9 +692,11 @@ gst_aac_parse_parse_adts_header (GstAacParse * aacparse, const guint8 * data,
> 
>     *rate = gst_aac_parse_get_sample_rate_from_index (sr_idx);
>   }
>-  if (channels)
>-    *channels = ((data[2] & 0x01) << 2) | ((data[3] & 0xc0) >> 6);
>-
>+  if (channels) {
>+    gint ch_idx = ((data[2] & 0x01) << 2) | ((data[3] & 0xc0) >> 6);
>+    
>+    *channels = gst_aac_parse_get_channels_from_index (ch_idx);
>+  }
>   if (version)
>     *version = (data[1] & 0x08) ? 2 : 4;
>   if (object)

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list