From 28c91d1c0ee25a92088ec4d58eaef6f6249a49eb Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 10 Mar 2024 16:48:26 +0100 Subject: [PATCH] Prepared code in VideoFFmpegComponent.cpp for how to handle the deprecated AVFrame::pkt_pos and AVFrame::pkt_size fields --- es-core/src/components/VideoFFmpegComponent.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/es-core/src/components/VideoFFmpegComponent.cpp b/es-core/src/components/VideoFFmpegComponent.cpp index d8db22453..7ecab9891 100644 --- a/es-core/src/components/VideoFFmpegComponent.cpp +++ b/es-core/src/components/VideoFFmpegComponent.cpp @@ -744,13 +744,23 @@ void VideoFFmpegComponent::readFrames() destFrame->pict_type = mVideoFrame->pict_type; destFrame->chroma_location = mVideoFrame->chroma_location; +#if LIBAVUTIL_VERSION_MAJOR > 58 || (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 29) + // TODO: Figure out how this should be done in >= 6.1 destFrame->pkt_pos = mVideoFrame->pkt_pos; +#else + destFrame->pkt_pos = mVideoFrame->pkt_pos; +#endif #if LIBAVUTIL_VERSION_MAJOR < 58 destFrame->pkt_duration = mVideoFrame->pkt_duration; #else destFrame->duration = mVideoFrame->duration; #endif +#if LIBAVUTIL_VERSION_MAJOR > 58 || (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 29) + // TODO: Figure out how this should be done in >= 6.1 destFrame->pkt_size = mVideoFrame->pkt_size; +#else + destFrame->pkt_size = mVideoFrame->pkt_size; +#endif } } else {