[MPlayer-dev-eng] [PATCH] ae_lavc.c samples per block fix for imaadpcm

joel Schantz joel_schantz at yahoo.com
Thu Jun 8 19:18:17 CEST 2006


Yea, I didn't like it myself. (simple fix for ugly code)

Try this patch.
Should be more portable, although it may not fit correct "coding
standards"

--- Michael Niedermayer <michaelni at gmx.at> wrote:

> Hi
> 
> On Wed, Jun 07, 2006 at 09:58:27PM -0700, joel Schantz wrote:
> > The index for storing of samples per block is calculated
> incorrectly.
> > It should be the 16 bits following the mux_a->wf->cbSize element.
> > (imaadpcm WAVEFORMATEX extra data wSamplesPerBlock)
> 
> yes, but your code is half wrong too (the svn code is double wrong)
> the author must have been thirsty ;)
> 
> @@ -64,7 +64,7 @@
>                 case 0x11: /* imaadpcm */
>                         mux_a->wf->wBitsPerSample = 4;
>                         mux_a->wf->cbSize = 2;
> -                       ((uint16_t*)mux_a->wf)[sizeof(WAVEFORMATEX)]
> =
> +                      
> ((uint16_t*)mux_a->wf)[sizeof(WAVEFORMATEX)/2] =
>                                 ((lavc_actx->block_align - 4 *
> lavc_actx->channels) / (4 * lavc_actx->channels)) * 8 + 1;
> 
> this code either wont work on little endian or on big endian cpus
> 
> [...]
> 
> -- 
> Michael     GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> In the past you could go to a library and read, borrow or copy any
> book
> Today you'd get arrested for mere telling someone where the library
> is
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ae_lavc-samplesperblock.patch
Type: application/octet-stream
Size: 748 bytes
Desc: 680621420-ae_lavc-samplesperblock.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060608/5fcb6087/attachment.obj>


More information about the MPlayer-dev-eng mailing list