[FFmpeg-devel] [PATCH] Move audioconvert API from libavcodec to libavcore.

Stefano Sabatini stefano.sabatini-lala
Tue Jan 11 00:20:39 CET 2011


On date Sunday 2011-01-09 19:52:26 +0100, Michael Niedermayer encoded:
> On Sun, Jan 09, 2011 at 10:58:19AM +0100, Stefano Sabatini wrote:
[...]
> > > >  AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
> > > >                                         enum AVSampleFormat in_fmt, int in_channels,
> > > >                                         const float *matrix, int flags)
> > > >  {
> > > > -    AVAudioConvert *ctx;
> > > > -    if (in_channels!=out_channels)
> > > > -        return NULL;  /* FIXME: not supported */
> > > > -    ctx = av_malloc(sizeof(AVAudioConvert));
> > > > -    if (!ctx)
> > > > +    AVAudioConvert *ctx = NULL;
> > > > +    if (av_audio_convert_alloc2(&ctx, out_fmt, out_channels, in_fmt, in_channels, matrix, flags) < 0)
> > > >          return NULL;
> > > 
> > > as you change the API, i would suggest you pass parent context and log offset
> > > so error messages can be logged correctly
> > > 
> > > except that the patch should be ok if tested
> > 
> > I agree this is better, but then it will break libavcodec ABI
> > compatibility. I wonder, is this a good occasion for bumping major?
> 
> maybe iam silly, but why would it break lavc ABI if the new function had
> these arguments?

Looks like I was wrong, I was concerned about the AVAudioConvert ->
AVAudioConvertContext change but since AVAudioConvert was opaque this
shouldn't be an issue.

Fixed other minor issues.
-- 
FFmpeg = Furious Fundamental Mysterious Pure Egregious Gadget



More information about the ffmpeg-devel mailing list