[MPlayer-dev-eng] [PATCH] WAVE_FORMAT_EXTENSIBLE doesn't get added by mplayer during dumping to multichannel WAV

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Feb 21 00:39:06 CET 2010


On Sat, Feb 20, 2010 at 06:14:39PM -0500, Jason Tackaberry wrote:
> On Sat, 2010-02-20 at 17:45 -0500, Jason Tackaberry wrote:
> > Updated patch attached.

I'd prefer it if you used
af_fmt2bits(ao_data.format)
also to calculate frame_size instead of adding a global variable.
Also it should be a bit more maintainable and possibly closer
to the "history" behind it to do

size = use_waveex ? 40 : 16;
id = ao_data.format == AF_FORMAT_FLOAT_LE ? WAV_ID_FLOAT_PCM : WAV_ID_PCM;
if (use_waveex)
    id = WAV_ID_FORMAT_EXTENSIBLE;
+    fput32le(size, fp);
+    fput16le(id, fp);
+    fput16le(ao_data.channels, fp);
+    fput32le(ao_data.samplerate, fp);
+    fput32le(ao_data.bps, fp);
+    fput16le(ao_data.channels * (bits / 8), fp);
+    fput16le(bits, fp);
+
+    if (use_waveex) {
...


> I forgot to mention: if 5 > channels > 8,

ex falsum quodlibet?
(SCNR, it took me a moment to figure out that you didn't mean
"if channels is in the range with lower limit 8 and upper limit 5")

> the resulting wave file with
> the patch has the same sha1sum as the wave file produced without the
> patch.

The real challenge would be to test on big-endian, 32 and 64 bit and
all supported formats and playback in all kinds of alternative players
etc, but that would be overkill.
And I'm against adding an option until someone finds a real issue.
However, above code snippet reminds you, unless MPlayer specifically
supports the "EXTENSIBLE" format, it's impossible that both AF_FORMAT_S32_LE
and AF_FORMAT_FLOAT_LE will work with it.



More information about the MPlayer-dev-eng mailing list