From 75a4ed1d3e9193d6312fe205f57c38bd21764c96 Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Wed, 24 Sep 2025 12:55:44 +0900
Subject: Fix FTBFS with ffmeg 8.0. This resolves issue #37

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 k9author/k9avidecode.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/k9author/k9avidecode.cpp b/k9author/k9avidecode.cpp
index c6e1217..4b34608 100644
--- a/k9author/k9avidecode.cpp
+++ b/k9author/k9avidecode.cpp
@@ -290,9 +290,6 @@ void k9AviDecode::close() {
         // Free the YUV frame
         av_free(m_Frame);
 
-        // Close the codec
-        avcodec_close(m_CodecCtx);
-
         // Close the video file
 #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
         avformat_close_input(&m_FormatCtx);
@@ -300,8 +297,11 @@ void k9AviDecode::close() {
         av_close_input_file(m_FormatCtx);
 #endif
 
+        // Close the codec
 #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
         avcodec_free_context(&m_CodecCtx);
+#else
+        avcodec_close(m_CodecCtx);
 #endif
 
         m_opened=false;
-- 
cgit v1.2.3

