From 01dc8379a173113cdf331e975865711238268563 Mon Sep 17 00:00:00 2001 From: max_10 Date: Tue, 24 Jan 2023 20:57:12 +0100 Subject: [PATCH] =?UTF-8?q?Fix=C2=A0build=C2=A0errors=C2=A0with=C2=A0FFmpe?= =?UTF-8?q?g5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/7042a6a7663e6d83441fb077913a8fb0d88260a0 Author: max_10 Date: 2023-01-24 (Tue, 24 Jan 2023) Origin message was: ------------------ - Fix build errors with FFmpeg5 ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3/container/container_ffmpeg.c | 4 +++- libeplayer3/external/ffmpeg/put_bits.h | 2 ++ libeplayer3/external/ffmpeg/src/bitstream.c | 1 + libeplayer3/include/manager.h | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libeplayer3/container/container_ffmpeg.c b/libeplayer3/container/container_ffmpeg.c index 6120998..74274f3 100644 --- a/libeplayer3/container/container_ffmpeg.c +++ b/libeplayer3/container/container_ffmpeg.c @@ -2294,11 +2294,13 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32 if (track.avCodecCtx) { ffmpeg_printf(10, " Handle inject_as_pcm = %d\n", track.inject_as_pcm); -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,0,100) + +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100) AVCodec *codec = avcodec_find_decoder(get_codecpar(stream)->codec_id); #else const AVCodec *codec = avcodec_find_decoder(get_codecpar(stream)->codec_id); #endif + int errorCode = avcodec_open2(track.avCodecCtx, codec, NULL); if (codec != NULL && !errorCode) { diff --git a/libeplayer3/external/ffmpeg/put_bits.h b/libeplayer3/external/ffmpeg/put_bits.h index 2265de4..7d76f2e 100644 --- a/libeplayer3/external/ffmpeg/put_bits.h +++ b/libeplayer3/external/ffmpeg/put_bits.h @@ -28,9 +28,11 @@ #include #include +#include #include "libavutil/intreadwrite.h" #include "libavutil/avassert.h" +#include "libavutil/common.h" typedef struct PutBitContext { diff --git a/libeplayer3/external/ffmpeg/src/bitstream.c b/libeplayer3/external/ffmpeg/src/bitstream.c index c992273..b9c5b43 100644 --- a/libeplayer3/external/ffmpeg/src/bitstream.c +++ b/libeplayer3/external/ffmpeg/src/bitstream.c @@ -30,6 +30,7 @@ #include #include +#include void avpriv_align_put_bits(PutBitContext *s) diff --git a/libeplayer3/include/manager.h b/libeplayer3/include/manager.h index 7e8b983..f610769 100644 --- a/libeplayer3/include/manager.h +++ b/libeplayer3/include/manager.h @@ -9,6 +9,10 @@ #include #include #include +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 0, 100) +#include +#include +#endif typedef enum {