[FFmpeg-devel] Alternate audio bit depth support
Tue Jun 23 13:28:48 CEST 2009
On Tue, Jun 23, 2009 at 12:10:25AM -0500, Brian Crowell wrote:
> 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;
> avcodec_decode_audio3( avctx, (short *) data, sizeof(data), packet );
> The next question is, is that intended?
Yes. The 'AVCodecContext->sample_fmt' field instructs the user/application
of the output format. This field has existed in libavcodec for a long time.
Applications that ignore sample_fmt are considered to be faulty.
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: Digital signature
More information about the ffmpeg-devel