[FFmpeg-devel] [PATCH] swr: allow passing of AVFrame.data to swr_convert without, cast in C++ code
wm4
nfxjfg at googlemail.com
Fri Dec 5 15:18:15 CET 2014
On Fri, 5 Dec 2014 14:15:03 +0100
Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Dec 05, 2014 at 04:14:53PM +0800, Yu Xiaolei wrote:
> >
> > ---
> > libswresample/swresample.c | 4 ++--
> > libswresample/swresample.h | 4 ++--
> > 2 files changed, 4 insertions(+), 4 deletions(-)
>
> This adds these warnings:
>
> ibswresample/swresample.c:380:13: note: expected ‘uint8_t **’ but argument is of type ‘uint8_t * const*’
> libswresample/swresample.c:693:5: warning: passing argument 2 of ‘fill_audiodata’ discards ‘const’ qualifier from pointer target type [enabled by default]
>
> also adding const breaks API sadly so it must be delayed until
> the next major version bump see:
> f00e9c4b10f5ab7cd382d3019eb7bee13fcc3866 for an example on how to
> do that
>
> [...]
Also, it would be much easier to use if const wasn't used at all.
Additionally, uint8_t is a pretty bad choice. uint8_t doesn't need to
have the same propery as char in that it can alias anything, even if
many C implementations end up typedefing uint8_t to (unsigned) char.
Maybe change it to void*?
More information about the ffmpeg-devel
mailing list