[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
Sat Feb 20 23:09:35 CET 2010


On Sat, Feb 20, 2010 at 04:49:24PM -0500, Jason Tackaberry wrote:
> +static void fput16le(int16_t val, FILE *fp) {
> +    fputc(val & 0x00ff, fp);
> +    fputc((val & 0xff00) >> 8, fp);
> +}
> +
> +static void fput32le(int32_t val, FILE *fp) {
> +    fput16le(val & 0x0000ffff, fp);
> +    fput16le((val & 0xffff0000) >> 16, fp);
> +}

Useless & ..., and why signed types for the values?
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);
}

> +            case 5: 

Trailing whitespace.

>      bits = af_fmt2bits(format);
> +    frame_size = le2me_16(bits) / 8;
> -    wavhdr.bits = le2me_16(bits);
> -        int frame_size = le2me_16(wavhdr.bits) / 8;

These certainly aren't equivalent.

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...



More information about the MPlayer-dev-eng mailing list