+/**
+ * Parse MPEG-4 audio configuration for ALS object type.
+ * @param[in] gb bit reader context
+ * @param[in] c MPEG4AudioConfig structure to fill
+ * @return on success 0 is returned, otherwise a value < 0
+ */
+static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c)
+{
+ if (get_bits_left(gb) < 112)
+ return -1;
+
+ if (get_bits_long(gb, 32) != MKBETAG('A','L','S','\0'))
+ return -1;
+
+ // override AudioSpecificConfig channel configuration and sample rate
+ // which are buggy in old ALS conformance files
+ c->sample_rate = get_bits_long(gb, 32);
+
+ // skip number of samples
+ skip_bits_long(gb, 32);
+
+ // read number of channels
+ c->chan_config = 0;
+ c->channels = get_bits(gb, 16) + 1;
+
+ return 0;
+}
+