[MPlayer-dev-eng] [PATCH] Extend ao_pcm to support more PCM formats
Peter Fordham
peter.fordham at gmail.com
Wed Jan 20 00:58:04 CET 2010
Find updated patch attached.
-Pete
2010/1/19 Reimar Döffinger <Reimar.Doeffinger at gmx.de>:
> On Tue, Jan 19, 2010 at 01:58:32PM -0800, Peter Fordham wrote:
>> @@ -111,32 +111,48 @@
>> strdup(ao_pcm_waveheader?"audiodump.wav":"audiodump.pcm");
>> }
>>
>> - bits=8;
>> - switch(format){
>> - case AF_FORMAT_S32_BE:
>> - format=AF_FORMAT_S32_LE;
>> - case AF_FORMAT_S32_LE:
>> - bits=32;
>> + switch (format & AF_FORMAT_BITS_MASK)
>> + {
>> + default:
>> + case AF_FORMAT_8BIT:
>> + bits = 8;
>> break;
>> - case AF_FORMAT_FLOAT_BE:
>> - format=AF_FORMAT_FLOAT_LE;
>> - case AF_FORMAT_FLOAT_LE:
>> - bits=32;
>> + case AF_FORMAT_16BIT:
>> + bits = 16;
>> break;
>> - case AF_FORMAT_S8:
>> - format=AF_FORMAT_U8;
>> - case AF_FORMAT_U8:
>> + case AF_FORMAT_24BIT:
>> + bits = 24;
>> break;
>> - case AF_FORMAT_AC3_BE:
>> - case AF_FORMAT_AC3_LE:
>> - bits=16;
>> + case AF_FORMAT_32BIT:
>> + bits = 32;
>> break;
>> - default:
>> - format=AF_FORMAT_S16_LE;
>> - bits=16;
>> + case AF_FORMAT_40BIT:
>> + bits = 40;
>> break;
>> + case AF_FORMAT_48BIT:
>> + bits = 48;
>> + break;
>> }
>
> Af_fmt2bits
>
>>
>> + if (ao_pcm_waveheader)
>> + {
>> + // WAV files must have one of the following formats
>> +
>> + switch(format){
>> + case AF_FORMAT_U8:
>> + case AF_FORMAT_S16_LE:
>> + case AF_FORMAT_S24_LE:
>> + case AF_FORMAT_S32_LE:
>> + case AF_FORMAT_FLOAT_LE:
>> + case AF_FORMAT_AC3_BE:
>> + case AF_FORMAT_AC3_LE:
>> + break;
>> + default:
>> + format = AF_FORMAT_S16_LE;
>> + break;
>> + }
>> + }
>
> Should be before, otherwise for the default case bits will be set to the wrong
> (don't know if it will be used in that case, but it's not a good idea either way)/
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcm.diff
Type: text/x-patch
Size: 1415 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100119/06a1c93e/attachment.bin>
More information about the MPlayer-dev-eng
mailing list