demux: wav: more robust chunk parsing
commit2309a6e2855b30fd838879b8a7c3ed1eedeec000
authorThomas Guillem <thomas@gllm.fr>
Thu, 12 Mar 2020 12:20:11 +0000 (12 13:20 +0100)
committerThomas Guillem <thomas@gllm.fr>
Mon, 16 Mar 2020 12:31:08 +0000 (16 13:31 +0100)
treea53e0672157924ebe94ce8681ca354e841e88397
parent9d7e963e054ba740e479792b1ff635cdc6736c30
demux: wav: more robust chunk parsing

From the spec:
"There are no restrictions upon the order of the chunks within a WAVE file,
with the exception that the Format chunk must precede the Data chunk."

The Wav demuxer can now parse chunks in any order. I don't check that the fmt
chunk is before the data one in order to be more resilient to broken samples.

This commit will allow to add new chunks more easily, specially chunks that can
be after the 'data' one. I'm thinking about the ADM support, that need 2
chunks, 'chna' and 'axml' that is after the 'data' chunk.
modules/demux/wav.c