On 04/23/2011 12:18 PM, Diego Biurrun wrote: > On Fri, Apr 22, 2011 at 10:19:44PM -0400, Justin Ruggles wrote: >> >> Based on patches by clsid2 in ffdshow-tryout. >> >> --- a/configure >> +++ b/configure >> @@ -95,6 +95,7 @@ Configuration options: >> --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding >> [no] >> + --enable-audio-float floating-point output from some audio decoders >> [no] > > The comment is not very descriptive.
Er, it is imo. > >> --- a/libavcodec/aacdec.c >> +++ b/libavcodec/aacdec.c >> @@ -549,7 +549,11 @@ static av_cold int aac_decode_init(AVCodecContext >> *avctx) >> >> +#if CONFIG_AUDIO_FLOAT >> + avctx->sample_fmt = AV_SAMPLE_FMT_FLT; >> +#else >> avctx->sample_fmt = AV_SAMPLE_FMT_S16; >> +#endif > > The code is now littered with these #if #else #endif blocks in many > places. Maybe you can just set a few #defines at the top depending > on whether or not CONFIG_AUDIO_FLOAT is in effect or not and use > them below. This would concentrate the #ifdeffery in one place. > Exactly how do you propose to do that? Anyway per my understanding the int16_t code is to be removed in the future. >> --- a/libavcodec/ac3dec.c >> +++ b/libavcodec/ac3dec.c >> @@ -1405,10 +1420,14 @@ static int ac3_decode_frame(AVCodecContext * avctx, >> void *data, int *data_size, >> - *data_size = s->num_blocks * 256 * avctx->channels * sizeof (int16_t); >> + *data_size = s->num_blocks * 256 * avctx->channels * >> sizeof(*out_samples); > > unrelated? Very much related. > >> --- a/libavcodec/dca.c >> +++ b/libavcodec/dca.c >> @@ -1812,9 +1817,10 @@ static int dca_decode_frame(AVCodecContext * avctx, >> return -1; >> } >> >> - if (*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * >> channels) >> + out_size = 256 / 8 * s->sample_blocks * sizeof(*samples) * channels; >> + if (*data_size < out_size) >> return -1; >> - *data_size = 256 / 8 * s->sample_blocks * sizeof(int16_t) * channels; >> + *data_size = out_size; > > unrelated? Very much related. > > Diego MvH Benjamin Larsson _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
