aacparse: fix object_type parsing off-by-one in ADTS frame
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 15 Jul 2013 16:15:44 +0000 (17:15 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 26 Jul 2013 08:44:10 +0000 (09:44 +0100)
According to http://wiki.multimedia.cx/index.php?title=ADTS,
the value stored in ADTS headers is one less than the object
type of the AAC stream.

A look at ffmpeg shows it also adds 1 to the value read off
the ADTS header.

Note that this might break other things that happen to have
an inverse off by one to match the existing code.

gst/audioparsers/gstaacparse.c

index 50e19a3..8291917 100644 (file)
@@ -677,7 +677,7 @@ gst_aac_parse_parse_adts_header (GstAacParse * aacparse, const guint8 * data,
   if (version)
     *version = (data[1] & 0x08) ? 2 : 4;
   if (object)
-    *object = (data[2] & 0xc0) >> 6;
+    *object = ((data[2] & 0xc0) >> 6) + 1;
 }
 
 /**