[FFmpeg-devel] [PATCH v2 67/90] avutil: Switch crypto APIs to size_t

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Tue Apr 20 01:39:26 EEST 2021


On Mon, Apr 19, 2021 at 10:33 PM Carl Eugen Hoyos <ceffmpeg at gmail.com>
wrote:

> Am Mo., 19. Apr. 2021 um 21:22 Uhr schrieb Andreas Rheinhardt
> <andreas.rheinhardt at outlook.com>:
> >
> > From: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> >
> > Announced in e435beb1ea5380a90774dbf51fdc8c941e486551.
> >
> > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> > ---
> > I forgot a printf specifier in tests/api/api-h264-test.c.
>
> > diff --git a/libavutil/version.h b/libavutil/version.h
> > index dbeb7ffe23..54b09534a2 100644
> > --- a/libavutil/version.h
> > +++ b/libavutil/version.h
> > @@ -105,9 +105,6 @@
> >   * @{
> >   */
> >
> > -#ifndef FF_API_CRYPTO_SIZE_T
> > -#define FF_API_CRYPTO_SIZE_T            (LIBAVUTIL_VERSION_MAJOR < 57)
> > -#endif
> >  #ifndef FF_API_FRAME_GET_SET
> >  #define FF_API_FRAME_GET_SET            (LIBAVUTIL_VERSION_MAJOR < 57)
> >  #endif
> > diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c
> > index 04bdfbc9d2..6f13e773f9 100644
> > --- a/tests/api/api-h264-test.c
> > +++ b/tests/api/api-h264-test.c
> > @@ -153,7 +153,7 @@ static int video_decode_example(const char
> *input_filename)
> >                  av_frame_unref(fr);
> >                  return number_of_written_bytes;
> >              }
>
> > -            printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n",
> video_stream,
> > +            printf("%d, %s, %s, %8"PRId64", %8d, 0x%08"PRIx32"\n",
> video_stream,
> >                     av_ts2str(fr->pts), av_ts2str(fr->pkt_dts),
> fr->pkt_duration,
> >                     number_of_written_bytes, av_adler32_update(0, (const
> uint8_t*)byte_buffer, number_of_written_bytes));
>
> Afaict, this change is either related to another patch or wrong.
>

For most hash APIs the size parameter has been switched to size_t;
for av_adler32_update(), the return value has been switched as well:
>From unsigned long to uint32_t. Therefore this printf specifier had to
be updated as well.
(Adler-32 checksums are 32bit, so uint32_t is the natural type for them.)

- Andreas


More information about the ffmpeg-devel mailing list