File fix-build.patch of Package vangers
diff --git a/lib/xsound/avi.cpp b/lib/xsound/avi.cpp
index cd33d8c..6d3a3ea 100644
--- a/lib/xsound/avi.cpp
+++ b/lib/xsound/avi.cpp
@@ -184,7 +184,7 @@ void AVIFile::draw(void) {
}
if(frame<0 && (flags & AVI_LOOPING)) {
// Close the codec
- avcodec_close(pCodecCtx);
+ avcodec_free_context(&pCodecCtx);
// Close the video file
//av_close_input_file(pFormatCtx);
avformat_close_input(&pFormatCtx);
@@ -248,7 +248,7 @@ void AVIFile::close(void)
// Free the YUV frame
av_free(pFrame);
// Close the codec
- avcodec_close(pCodecCtx);
+ avcodec_free_context(&pCodecCtx);
// Close the video file
//av_close_input_file(pFormatCtx);
//avformat_free_context(pFormatCtx);
diff --git a/lib/xsound/avi.h b/lib/xsound/avi.h
index 32c6eb3..a3209dc 100644
--- a/lib/xsound/avi.h
+++ b/lib/xsound/avi.h
@@ -13,6 +13,7 @@ extern "C" {
#endif
#include <avformat.h>
+#include <avcodec.h>
#ifdef __cplusplus
}
#endif
@@ -24,7 +25,7 @@ struct AVIFile : XListElement
{
AVFormatContext *pFormatCtx;
AVCodecContext *pCodecCtx;
- AVCodec *pCodec;
+ const AVCodec *pCodec;
AVFrame *pFrame;
AVPacket packet;
int videoStream;