[FFmpeg-devel] Alternate audio bit depth support

Brian Crowell brian
Tue Jun 23 07:10:25 CEST 2009


On Mon, Jun 22, 2009 at 3:04 PM, Ronald S. Bultje<rsbultje at gmail.com> wrote:
> I'd rather also see a avcodec_decode_audio4() that does not implicitly
> assume that all your audio shall be decoded to int16 at some level.

Well, after a lot more reading (and probably because I was looking at
the Ubuntu sources before) I've come to the conclusion that that's
what avcodec_decode_audio3() already does.

In other words, it looks like int16_t *samples is a ruse. If
avctx->sample_fmt is SAMPLE_FMT_FLT, you can just do:

  float data[32];
  avcodec_decode_audio3( avctx, (short *) data, sizeof(data), packet );

The next question is, is that intended?

--Brian



More information about the ffmpeg-devel mailing list