summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-17 16:45:03 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-17 16:45:03 +0100
commit9e2f9fc0893ce7eaa65144af421358be9c140d0a (patch)
tree190fc4d62b319b9347abfe9d1dc2254381f2bb8d
parentcd1737923c223e001d57bc8ec31490cf033bc3e8 (diff)
ffmpeg: backwards compat fixes
-rw-r--r--plugins/ffmpeg/ffmpeg.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index 57707f98..adc86d75 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -97,7 +97,7 @@ typedef struct {
AVCodecContext *ctx;
AVFormatContext *fctx;
AVPacket pkt;
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 40, 0)
AVFrame *frame;
#endif
int stream_id;
@@ -229,7 +229,7 @@ ffmpeg_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
return -1;
}
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 40, 0)
info->frame = avcodec_alloc_frame();
#endif
@@ -273,10 +273,14 @@ ffmpeg_free (DB_fileinfo_t *_info) {
trace ("ffmpeg: free\n");
ffmpeg_info_t *info = (ffmpeg_info_t*)_info;
if (info) {
-#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53, 25, 0)
+#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(54, 59, 100)
if (info->frame) {
avcodec_free_frame(&info->frame);
}
+#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 40, 0)
+ if (info->frame) {
+ av_freep (&info->frame);
+ }
#endif
if (info->buffer) {
free (info->buffer);
@@ -336,7 +340,7 @@ ffmpeg_read (DB_fileinfo_t *_info, char *bytes, int size) {
int len;
//trace ("in: out_size=%d(%d), size=%d\n", out_size, AVCODEC_MAX_AUDIO_FRAME_SIZE, size);
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 40, 0)
int got_frame = 0;
len = avcodec_decode_audio4(info->ctx, info->frame, &got_frame, &info->pkt);
if (len > 0) {