Browse code

Support "VLB " audio in NSV files.

See samples/nsv/vlb_audio.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>

Reimar Döffinger authored on 2011/12/12 01:37:40
Showing 3 changed files
... ...
@@ -300,6 +300,7 @@ typedef struct {
300 300
     DECLARE_ALIGNED(32, float, temp)[128];
301 301
 
302 302
     enum OCStatus output_configured;
303
+    int warned_num_aac_frames;
303 304
 } AACContext;
304 305
 
305 306
 #endif /* AVCODEC_AAC_H */
... ...
@@ -2125,13 +2125,14 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
2125 2125
         }
2126 2126
         if (!ac->avctx->sample_rate)
2127 2127
             ac->avctx->sample_rate = hdr_info.sample_rate;
2128
-        if (hdr_info.num_aac_frames == 1) {
2129
-            if (!hdr_info.crc_absent)
2130
-                skip_bits(gb, 16);
2131
-        } else {
2128
+        if (!ac->warned_num_aac_frames && hdr_info.num_aac_frames != 1) {
2129
+            // This is 2 for "VLB " audio in NSV files.
2130
+            // See samples/nsv/vlb_audio.
2132 2131
             av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame is", 0);
2133
-            return -1;
2132
+            ac->warned_num_aac_frames = 1;
2134 2133
         }
2134
+        if (!hdr_info.crc_absent)
2135
+            skip_bits(gb, 16);
2135 2136
     }
2136 2137
     return size;
2137 2138
 }
... ...
@@ -206,6 +206,7 @@ static const AVCodecTag nsv_codec_audio_tags[] = {
206 206
     { CODEC_ID_MP3,       MKTAG('M', 'P', '3', ' ') },
207 207
     { CODEC_ID_AAC,       MKTAG('A', 'A', 'C', ' ') },
208 208
     { CODEC_ID_AAC,       MKTAG('A', 'A', 'C', 'P') },
209
+    { CODEC_ID_AAC,       MKTAG('V', 'L', 'B', ' ') },
209 210
     { CODEC_ID_SPEEX,     MKTAG('S', 'P', 'X', ' ') },
210 211
     { CODEC_ID_PCM_U16LE, MKTAG('P', 'C', 'M', ' ') },
211 212
     { CODEC_ID_NONE,      0 },