[FFmpeg-devel] [PATCH 1/4] lavc/parser: use C11 atomics

Rostislav Pehlivanov atomnuker at gmail.com
Thu Nov 30 13:55:03 EET 2017


On 28 November 2017 at 01:26, Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Mon, Nov 27, 2017 at 04:30:18AM +0000, Rostislav Pehlivanov wrote:
> > Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
> > ---
> >  libavcodec/parser.c | 14 ++++++++------
> >  1 file changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/libavcodec/parser.c b/libavcodec/parser.c
> > index 670680ea7c..baf1de4d88 100644
> > --- a/libavcodec/parser.c
> > +++ b/libavcodec/parser.c
> > @@ -23,30 +23,32 @@
> >  #include <inttypes.h>
> >  #include <stdint.h>
> >  #include <string.h>
> > +#include <stdatomic.h>
> >
> >  #include "libavutil/avassert.h"
> > -#include "libavutil/atomic.h"
> >  #include "libavutil/internal.h"
> >  #include "libavutil/mem.h"
> >
> >  #include "internal.h"
> >  #include "parser.h"
> >
> > -static AVCodecParser *av_first_parser = NULL;
> > +static _Atomic(AVCodecParser *)av_first_parser = NULL;
>
> This doesnt build here
>
> libavcodec/parser.c:35:8: warning: return type defaults to ‘int’ [enabled
> by default]
>  static _Atomic(AVCodecParser *)av_first_parser = NULL;
>         ^
> libavcodec/parser.c: In function ‘_Atomic’:
> libavcodec/parser.c:35:32: error: expected declaration specifiers before
> ‘av_first_parser’
>  static _Atomic(AVCodecParser *)av_first_parser = NULL;
>                                 ^
> libavcodec/parser.c:38:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘{’ token
>  {
>  ^
> libavcodec/parser.c:46:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘{’ token
>  {
>  ^
> libavcodec/parser.c:55:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__a
>
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Observe your enemies, for they first find out your faults. -- Antisthenes
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>

Does the attached patch work?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2-0001-lavc-parser-use-C11-atomics.patch
Type: text/x-diff
Size: 2048 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171130/50c058f9/attachment.patch>


More information about the ffmpeg-devel mailing list