[MPlayer-dev-eng] [PATCH] WAVE_FORMAT_EXTENSIBLE doesn't get added by mplayer during dumping to multichannel WAV
Jason Tackaberry
tack at urandom.ca
Sat Feb 20 23:45:27 CET 2010
On Sat, 2010-02-20 at 23:09 +0100, Reimar Döffinger wrote:
> Useless & ..., and why signed types for the values?
I noticed the parameter was signed just after I emailed the patch. It
should be unsigned.
> Also a nicer way would be e.g.
> static void fput32le(uint32_t val, FILE *fp)
> {
> uint8_t bytes[4] = {val, val >> 8, val >> 16, val >> 24};
> fwrite(bytes, 1, 4, fp);
> }
I like this better too, thanks.
> > + frame_size = le2me_16(bits) / 8;
> > - wavhdr.bits = le2me_16(bits);
> > - int frame_size = le2me_16(wavhdr.bits) / 8;
>
> These certainly aren't equivalent.
Oops, indeed. Fixed.
Updated patch attached.
> Also, a rather important question is: can MPlayer play those generated
> files? I think it doesn't, and it's not particularly intuitive or user-friendly
> if MPlayer creates files it can't play...
It does in fact play, because the key fields (channels, sample rate,
sample size) are in the same spot. The demuxer skips over the rest of
the header which it doesn't understand (namely the channel mask and
guid).
The only real noticeable effect is that for PCM, the wFormatTag field is
0xfffe instead of 0x01. But, AFAICT, provided the format is PCM, the
same code path is followed.
In other words, MPlayer can already handle a wave file with a
WAVEFORMATEXTENSIBLE header provided the format is PCM, which is what
ao_pcm produces.
However, I could make it an option if you'd like.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ao_pcm-waveformatextensible.diff
Type: text/x-patch
Size: 5283 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100220/08c61b40/attachment.bin>
More information about the MPlayer-dev-eng
mailing list