[FFmpeg-devel] [PATCH] swr: allow passing of AVFrame.data to swr_convert without, cast in C++ code

Michael Niedermayer michaelni at gmx.at
Fri Dec 5 17:50:30 CET 2014


On Fri, Dec 05, 2014 at 03:18:15PM +0100, wm4 wrote:
> 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*?

void is awkward as you cannot add a offset to it also you loose the
bit of type checking thats there when theres no cast

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141205/615f160b/attachment.asc>


More information about the ffmpeg-devel mailing list