]> git.sesse.net Git - c64tapwav/blobdiff - audioreader.cpp
More compatibility fixes for older ffmpeg.
[c64tapwav] / audioreader.cpp
index e133afce9a24c704ec47e56d8cd2072bbe0f0ff4..172bd31dd72bafe88e558d9cab605a4c8b124ed4 100644 (file)
@@ -5,6 +5,7 @@ extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
 #include <libswresample/swresample.h>
+#include <libavutil/avutil.h>
 
 }
 
@@ -22,7 +23,8 @@ struct AVFormatCloserAndDeleter {
 
 struct AVCodecContextDeleter {
        void operator() (AVCodecContext *ctx) {
-               avcodec_free_context(&ctx);
+               avcodec_close(ctx);
+               av_freep(&ctx);
        }
 };