From f8d23302149f86d9d7e8cd121517955d5b8fc790 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 28 Aug 2021 15:22:23 +0200 Subject: [PATCH] build with ffmpeg version > 59.0.100 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/343c8455b637bd5d21814b6d1fdcfccb33ca911b Author: Jacek Jendrzej Date: 2021-08-28 (Sat, 28 Aug 2021) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libdvbsub/dvbsubtitle.h | 6 +++++- src/driver/audiodec/ffmpegdec.cpp | 7 +++++++ src/driver/audiodec/ffmpegdec.h | 4 ++++ src/driver/record.cpp | 5 +++++ src/driver/streamts.h | 1 + src/gui/streaminfo2.cpp | 1 + 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/libdvbsub/dvbsubtitle.h b/lib/libdvbsub/dvbsubtitle.h index 7675c7453..fef10ff22 100644 --- a/lib/libdvbsub/dvbsubtitle.h +++ b/lib/libdvbsub/dvbsubtitle.h @@ -32,7 +32,11 @@ private: pthread_mutex_t mutex; cList *bitmaps; AVCodecContext * avctx; - AVCodec * avcodec; +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,0,100) + AVCodec *avcodec; +#else + const AVCodec *avcodec; +#endif int min_x, min_y, max_x, max_y; cTimeMs Timeout; public: diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 613f92cfa..d0253ff3a 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -1,3 +1,5 @@ + + /* Neutrino-GUI - DBoxII-Project @@ -44,6 +46,7 @@ extern "C" { #include #include #include +#include } #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1) @@ -164,7 +167,11 @@ bool CFfmpegDec::Init(void *_in, const CFile::FileType /*ft*/) return false; } avc->pb = avioc; +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,0,100) avc->flags |= AVFMT_FLAG_CUSTOM_IO|AVFMT_FLAG_KEEP_SIDE_DATA; +#else + avc->flags |= AVFMT_FLAG_CUSTOM_IO; +#endif AVInputFormat *input_format = NULL; diff --git a/src/driver/audiodec/ffmpegdec.h b/src/driver/audiodec/ffmpegdec.h index 6e42fb0d8..c223e050e 100644 --- a/src/driver/audiodec/ffmpegdec.h +++ b/src/driver/audiodec/ffmpegdec.h @@ -54,7 +54,11 @@ private: size_t buffer_size; unsigned char *buffer; AVFormatContext *avc; +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,0,100) AVCodec *codec; +#else + const AVCodec *codec; +#endif AVCodecContext *c; AVIOContext *avioc; int best_stream; diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 5f32001ab..c4a021350 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -66,6 +66,7 @@ extern "C" { #include +#include } #if (LIBAVCODEC_VERSION_MAJOR > 55) @@ -2336,7 +2337,11 @@ bool CStreamRec::Open(CZapitChannel * channel) #endif std::string tsfile = std::string(filename) + ".ts"; +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,0,100) AVOutputFormat *ofmt = av_guess_format(NULL, tsfile.c_str(), NULL); +#else + const AVOutputFormat *ofmt = av_guess_format(NULL, tsfile.c_str(), NULL); +#endif if (ofmt == NULL) { printf("%s: av_guess_format for [%s] failed!\n", __FUNCTION__, tsfile.c_str()); return false; diff --git a/src/driver/streamts.h b/src/driver/streamts.h index 819508845..014ed994c 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -33,6 +33,7 @@ extern "C" { #include +#include } typedef std::set stream_pids_t; diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index f0d1a1778..612b53ed6 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -34,6 +34,7 @@ extern "C" { #include #include +#include } #include