diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 33f408b..879a8c6 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -327,7 +327,7 @@ AVCodecContext* open_codec(AVMediaType mediaType, AVFormatContext* formatContext AVCodec * codec = NULL; AVCodecContext * codecContext = NULL; int stream_index; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57,25,101) stream_index = av_find_best_stream(formatContext, mediaType, -1, -1, NULL, 0); if (stream_index >= 0) { codecContext = formatContext->streams[stream_index]->codec; diff --git a/libeplayer3-sh4/include/input.h b/libeplayer3-sh4/include/input.h index 434aa23..c842f21 100644 --- a/libeplayer3-sh4/include/input.h +++ b/libeplayer3-sh4/include/input.h @@ -38,7 +38,7 @@ extern "C" { #include } -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) #define EPLAYER_MAX_CODECS 16 struct CodecList { @@ -71,7 +71,7 @@ class Input Player *player; AVFormatContext *avfc; -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) CodecList codecs[EPLAYER_MAX_CODECS]; #endif uint64_t readCount; diff --git a/libeplayer3-sh4/include/writer.h b/libeplayer3-sh4/include/writer.h index 19795ea..8f13d94 100644 --- a/libeplayer3-sh4/include/writer.h +++ b/libeplayer3-sh4/include/writer.h @@ -38,7 +38,7 @@ extern "C" { #define AV_CODEC_ID_INJECTPCM AV_CODEC_ID_PCM_S16LE /* wrapper */ -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) static AVCodecParameters __attribute__ ((unused)) *get_codecpar(AVStream *stream) { return stream->codecpar; diff --git a/libeplayer3-sh4/input.cpp b/libeplayer3-sh4/input.cpp index 9ade24c..167b451 100644 --- a/libeplayer3-sh4/input.cpp +++ b/libeplayer3-sh4/input.cpp @@ -54,7 +54,7 @@ Input::Input() seek_avts_abs = INT64_MIN; seek_avts_rel = 0; abortPlayback = false; -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) for (int n = 0;n < EPLAYER_MAX_CODECS;n++) codecs[n].codec = NULL; #endif @@ -114,7 +114,7 @@ static void logprintf(const char *format, ...) AVCodecContext *Input::GetCodecContext(unsigned int index) { -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) if (codecs[index].codec) { return codecs[index].codec; } @@ -376,7 +376,7 @@ bool Input::ReadSubtitle(const char *filename, const char *format, int pid) AVCodecContext *c = NULL; AVCodec *codec = NULL; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57,25,101) c = subavfc->streams[0]->codec; #else c = avcodec_alloc_context3(codec); @@ -412,7 +412,7 @@ bool Input::ReadSubtitle(const char *filename, const char *format, int pid) av_packet_unref(&packet); } avcodec_close(c); -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) avcodec_free_context(&c); #endif avformat_close_input(&subavfc); @@ -509,8 +509,8 @@ again: avfc->iformat->flags |= AVFMT_SEEK_TO_PTS; avfc->flags = AVFMT_FLAG_GENPTS; if (player->noprobe) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(55, 43, 100)) || \ - (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57, 25, 0)) +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(55, 43, 100) || \ + LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57, 25, 0) avfc->max_analyze_duration = 1; #else avfc->max_analyze_duration2 = 1; @@ -715,7 +715,7 @@ bool Input::Stop() if (avfc) { OpenThreads::ScopedLock lock(mutex); for (unsigned int i = 0; i < avfc->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) if (codecs[i].codec) avcodec_free_context(&codecs[i].codec); #else diff --git a/libeplayer3-sh4/writer/pcm.cpp b/libeplayer3-sh4/writer/pcm.cpp index 7c06dd0..4d1a305 100644 --- a/libeplayer3-sh4/writer/pcm.cpp +++ b/libeplayer3-sh4/writer/pcm.cpp @@ -251,7 +251,7 @@ bool WriterPCM::Write(AVPacket *packet, int64_t pts) decoded_frame = NULL; } -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57,25,101) AVCodec *codec = avcodec_find_decoder(c->codec_id); if (!codec) { fprintf(stderr, "%s %d: avcodec_find_decoder(%llx)\n", __func__, __LINE__, (unsigned long long) c->codec_id); diff --git a/libspark/video.cpp b/libspark/video.cpp index 6a2311a..599fec6 100644 --- a/libspark/video.cpp +++ b/libspark/video.cpp @@ -300,7 +300,7 @@ AVCodecContext* open_codec(AVMediaType mediaType, AVFormatContext* formatContext AVCodec * codec = NULL; AVCodecContext * codecContext = NULL; int stream_index; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) +#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57,25,101) stream_index = av_find_best_stream(formatContext, mediaType, -1, -1, NULL, 0); if (stream_index >=0 ){ codecContext = formatContext->streams[stream_index]->codec; @@ -360,7 +360,7 @@ int image_to_mpeg2(const char *image_name, const char *encode_name) av_packet_unref(&packet); } avcodec_close(codecContext); -#if (LIBAVFORMAT_VERSION_INT > AV_VERSION_INT( 57,25,100 )) +#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(57,25,100) avcodec_free_context(&codecContext); #endif }