[FFmpeg-devel] [PATCH v3] avcodec: fix atomics usage for h264/mpeg error_count

Aman Gupta ffmpeg at tmm1.net
Tue Mar 13 18:02:57 EET 2018


On Tue, Mar 13, 2018 at 4:39 AM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Mon, Mar 12, 2018 at 06:49:19PM -0700, Aman Gupta wrote:
> > From: Aman Gupta <aman at tmm1.net>
> >
> > ---
> >  libavcodec/h264_slice.c    |  5 +++--
> >  libavcodec/mpeg12dec.c     | 12 +++++++-----
> >  libavcodec/mpegvideo_enc.c |  3 ++-
> >  3 files changed, 12 insertions(+), 8 deletions(-)
>
> Iam a little bit confused, you write about "fixing" but not what this is
> fixing and it appears there are several distinct types of changes


The type of error_count is already atomic_int. I don't know when that was
changed.

The fix here is that these files do not compile on FreeBSD because of
errors such as:

[2018-03-11 18:26:55.078686] [freebsd-x86_64] libavcodec/mpegvideo_enc.c:
In function 'merge_context_after_encode':

[2018-03-11 18:26:55.081607] [freebsd-x86_64]
libavcodec/mpegvideo_enc.c:3578:33: error: invalid operands to binary +
(have 'atomic_int' and 'atomic_int')


[2018-03-11 16:43:23.543072] [freebsd-x86_64] CC    libavcodec/mpeg12dec.o

[2018-03-11 16:43:23.768864] [freebsd-x86_64] libavcodec/mpeg12dec.c: In
function 'slice_decode_thread':

[2018-03-11 16:43:23.769713] [freebsd-x86_64]
libavcodec/mpeg12dec.c:1996:23: error: incompatible types when assigning to
type 'atomic_int' from type 'int'

[2018-03-11 16:43:23.769808] [freebsd-x86_64]      s->er.error_count = (3 *
(s->end_mb_y - s->start_mb_y) * s->mb_width) >> field_pic;


[2018-03-11 15:40:00.186073] [freebsd-x86_64] CC    libavcodec/h264_slice.o

[2018-03-11 15:40:00.335377] [freebsd-x86_64] libavcodec/h264_slice.c: In
function 'ff_h264_execute_decode_slices':

[2018-03-11 15:40:00.336554] [freebsd-x86_64]
libavcodec/h264_slice.c:2765:36: error: incompatible types when assigning
to type 'atomic_int' from type 'int'

[2018-03-11 15:40:00.336639] [freebsd-x86_64]
sl->er.error_count
= 0;

Aman


>
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Asymptotically faster algorithms should always be preferred if you have
> asymptotical amounts of data
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list