summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneejit1 <aneejit1@gmail.com>2022-05-20 12:46:57 +0000
committeraneejit1 <aneejit1@gmail.com>2022-05-20 17:15:48 +0000
commitbd83eb09514fca0b6575c552d02227181d0545b2 (patch)
treed6ab61d040950f22b98ca568fcb014fc93f25968
parentbeaa801c7b120847e93ea287b3370ff96545e9a4 (diff)
downloadk9copy-bd83eb09514fca0b6575c552d02227181d0545b2.tar.gz
k9copy-bd83eb09514fca0b6575c552d02227181d0545b2.zip
Fix problems for older ffmpeg versions
Fix the following issues when building against older ffmpeg versions - the call to avcodec_free_context exceptions as avformat_close_input already performs cleanup of the AVCodecContext, so link the calling of avcodec_free_context in the close method of k9avidecode.cpp to the version of libavformat in which codecpar appeared rather than when avcodec_free_context appeared. - avcodec_decode_video2 was deprecated in libavcodec 57.106.100, not 57.12.100, so the version has been corrected. Signed-off-by: aneejit1 <aneejit1@gmail.com>
-rw-r--r--k9author/k9avidecode.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/k9author/k9avidecode.cpp b/k9author/k9avidecode.cpp
index 107f9ae..ff380d5 100644
--- a/k9author/k9avidecode.cpp
+++ b/k9author/k9avidecode.cpp
@@ -216,7 +216,7 @@ void k9AviDecode::readFrame(double _seconds) {
// Is this a packet from the video stream?
if (packet->stream_index==m_videoStream) {
// Decode video frame
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 37, 100)
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 106, 100)
int ret = avcodec_receive_frame(m_CodecCtx, m_Frame);
if (ret == 0)
frameFinished = 1;
@@ -300,7 +300,7 @@ void k9AviDecode::close() {
av_close_input_file(m_FormatCtx);
#endif
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 63, 100)
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
avcodec_free_context(&m_CodecCtx);
#endif