Hi, On Sat, Apr 23, 2011 at 7:24 AM, Diego Biurrun <[email protected]> wrote: > Something like this at the top of the file (note that the names could > likely be improved): > > #if CONFIG_AUDIO_FLOAT > #define AV_SAMPLE_FMT_NATIVE AV_SAMPLE_FMT_FLT > #else > #define AV_SAMPLE_FMT_NATIVE AV_SAMPLE_FMT_S16 > #endif > > and then the above ugly block just reads > > avctx->sample_fmt = AV_SAMPLE_FMT_NATIVE; > > Since at least the AV_SAMPLE_FMT thing is used in multiple places > within each file, this should even save some lines. Also, I think > both AAC and AC-3 used the same formats, probably more codecs do, > so this could be placed in a common header, saving even more > #ifdeffery...
As Benjamin said, this makes the future step of removing codepaths easier. Instead of removing 5 and adding 1, we simply remove 4 and keep 1. (That happens when audioconvert is finally sane and we output planar audio.) I'm not overly happy with the configure option. Justin, do you think it's possible to refactor this to work through request_sample_fmt directly? Ronald _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
