diff options
Diffstat (limited to 'plugins/ffmpeg/ffmpeg.c')
-rw-r--r-- | plugins/ffmpeg/ffmpeg.c | 12 |
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) { |