Skip to content

Commit

Permalink
Merge pull request #512 from steils/develop
Browse files Browse the repository at this point in the history
FFmpegUtilities: replace variable definition with statement expression
  • Loading branch information
ferdnyc committed May 16, 2020
2 parents 6e7ad23 + 1329036 commit 9922479
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions include/FFmpegUtilities.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9922479

Please sign in to comment.