[FFmpeg-devel] [PATCH] convert to S16 when resampling is requested

Michael Niedermayer michaelni
Sat Jan 31 22:31:21 CET 2009


On Sat, Jan 31, 2009 at 10:53:04AM -0800, David DeHaven wrote:
> 
> >
> > +    AVAudioConvert *convert_ctx[2];
> > +    enum SampleFormat sample_fmt; ///< input sample format
> > +    unsigned sample_size;         ///< size of one sample in  
> > sample_fmt
> > +    short *buffer[2];             ///< buffers used for conversion  
> > to S16
> > +    unsigned buffer_size[2];      ///< sizes of allocated buffers
> 
> If you convert back, you could end up with three convert contexts if  
> the output format doesn't like S16. I did this with one convert  
> context in resample.c and most of the time it doesn't have to convert  
> after resampling since the encoder likes S16 anyways.
> 

> Ideally, the resampling should be part of the converter. Then you  

exactly, that was what i suggested ages ago (that is do it like swscale)
sadly noone implemented it :(

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090131/ae12bee3/attachment.pgp>



More information about the ffmpeg-devel mailing list