mssdemux: fix setting codec_data when using WaveFormatEx
authorAntonio Ospite <ospite@studenti.unina.it>
Thu, 31 Oct 2013 16:16:14 +0000 (17:16 +0100)
committerThiago Santos <ts.santos@sisa.samsung.com>
Wed, 27 Nov 2013 12:26:36 +0000 (09:26 -0300)
commitc4fbff50dfa99e0f725a8690b0d0ff8509300a95
treea2719cfba1bb9f81ff560a4728f01fc33a173002
parentf02e7a24394541c0585dedb53325bb2b5cdf349f
mssdemux: fix setting codec_data when using WaveFormatEx

When using WaveFormatEx the actual codec private data is at the end of
the wav header structure, after the cbSize field, see for example the
notes at http://wiki.multimedia.cx/index.php?title=WAVEFORMATEX

The previous code was erroneously passing the whole WAVEFORMATEX
structure as codec_data.

The smoothstreaming specifications[1,2,3] always mention WAVEFORMATEX
and never smaller structures like WAVEFORMAT or PCMWAVEFORMAT, so the
buffer can assumed to be at least 18 bytes and always consuming the wav
header gives the (possibly empty) codec private data.

[1] http://web.archive.org/web/20120907004742/http://www.iis.net/community/files/media/smoothspecs/%5BMS-SMTH%5D.pdf
[2] http://download.microsoft.com/download/B/0/B/B0B199DB-41E6-400F-90CD-C350D0C14A53/%5BMS-SSTR%5D.pdf
[3] http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-SSTR%5D.pdf

https://bugzilla.gnome.org/show_bug.cgi?id=699924
ext/smoothstreaming/gstmssmanifest.c