aacparse: Avoid over-skipping when checking LOAS config
authorEdward Hervey <edward@centricular.com>
Mon, 30 Nov 2015 07:42:35 +0000 (08:42 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 2 Dec 2015 13:12:55 +0000 (14:12 +0100)
There might be multiple LOAS config in a row in a full frame. The first
one might be a multi-layer config (which we can't properly parse yet)...
but then followed by a valid (single-layer) one.

The code was previously skipping whole frames (instead of just the LOAS
config we failed to read) resulting in multiple frames (seen up to 6s in
some situation) being dropped before finally getting the configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=758826

gst/audioparsers/gstaacparse.c

index cd75b7f..3e4d64c 100644 (file)
@@ -1302,7 +1302,10 @@ gst_aac_parse_handle_frame (GstBaseParse * parse,
       /* This is pretty normal when skipping data at the start of
        * random stream (MPEG-TS capture for example) */
       GST_DEBUG_OBJECT (aacparse, "Error reading LOAS config. Skipping.");
-      *skipsize = map.size;
+      /* Since we don't fully parse the LOAS config, we don't know for sure
+       * how much to skip. Just skip 1 to end up to the next marker and
+       * resume parsing from there */
+      *skipsize = 1;
       goto exit;
     }