libopenshot: fix variable definition for gcc10

See https://github.com/OpenShot/libopenshot/pull/512

[ci skip]
This commit is contained in:
Jürgen Buchmüller 2020-08-19 17:10:28 +02:00
parent 0d22886859
commit 1a638daebc

View file

@ -0,0 +1,34 @@
--- a/include/FFmpegUtilities.h 2020-03-03 09:00:06.000000000 +0100
+++ b/include/FFmpegUtilities.h 2020-08-19 17:04:58.535806744 +0200
@@ -163,11 +163,10 @@
#define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
#define AV_FIND_DECODER_CODEC_ID(av_stream) av_stream->codecpar->codec_id
- auto AV_GET_CODEC_CONTEXT = [](AVStream* av_stream, AVCodec* av_codec) { \
- AVCodecContext *context = avcodec_alloc_context3(av_codec); \
- avcodec_parameters_to_context(context, av_stream->codecpar); \
- return context; \
- };
+ #define AV_GET_CODEC_CONTEXT(av_stream, av_codec) \
+ ({ AVCodecContext *context = avcodec_alloc_context3(av_codec); \
+ avcodec_parameters_to_context(context, av_stream->codecpar); \
+ context; })
#define AV_GET_CODEC_PAR_CONTEXT(av_stream, av_codec) av_codec;
#define AV_GET_CODEC_FROM_STREAM(av_stream,codec_in)
#define AV_GET_CODEC_ATTRIBUTES(av_stream, av_context) av_stream->codecpar
@@ -199,11 +198,10 @@
#define AV_FREE_CONTEXT(av_context) avcodec_free_context(&av_context)
#define AV_GET_CODEC_TYPE(av_stream) av_stream->codecpar->codec_type
#define AV_FIND_DECODER_CODEC_ID(av_stream) av_stream->codecpar->codec_id
- auto AV_GET_CODEC_CONTEXT = [](AVStream* av_stream, AVCodec* av_codec) { \
- AVCodecContext *context = avcodec_alloc_context3(av_codec); \
- avcodec_parameters_to_context(context, av_stream->codecpar); \
- return context; \
- };
+ #define AV_GET_CODEC_CONTEXT(av_stream, av_codec) \
+ ({ AVCodecContext *context = avcodec_alloc_context3(av_codec); \
+ avcodec_parameters_to_context(context, av_stream->codecpar); \
+ context; })
#define AV_GET_CODEC_PAR_CONTEXT(av_stream, av_codec) av_codec;
#define AV_GET_CODEC_FROM_STREAM(av_stream,codec_in)
#define AV_GET_CODEC_ATTRIBUTES(av_stream, av_context) av_stream->codecpar