From efd4d56de515cb167625ac730e814d265383aa5e Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 6 Jan 2014 21:41:30 +0100 Subject: [PATCH] Fix a few missing libav conditions --- src/filescanner_ffmpeg.c | 2 ++ src/transcode.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/filescanner_ffmpeg.c b/src/filescanner_ffmpeg.c index 69ef2ded..b276a0ca 100644 --- a/src/filescanner_ffmpeg.c +++ b/src/filescanner_ffmpeg.c @@ -385,12 +385,14 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi) #else case CODEC_TYPE_VIDEO: #endif +#if LIBAVFORMAT_VERSION_MAJOR >= 55 || (LIBAVFORMAT_VERSION_MAJOR == 54 && LIBAVFORMAT_VERSION_MINOR >= 20) if (ctx->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC) { DPRINTF(E_DBG, L_SCAN, "Found embedded artwork (stream %d)\n", i); break; } +#endif if (!video_stream) { DPRINTF(E_DBG, L_SCAN, "File has video (stream %d)\n", i); diff --git a/src/transcode.c b/src/transcode.c index b8ad74d7..a92477af 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -347,9 +347,12 @@ transcode(struct transcode_ctx *ctx, struct evbuffer *evbuf, int wanted) ctx->offset += processed; -#if LIBAVCODEC_VERSION_MAJOR >= 54 || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 35) +#if LIBAVCODEC_VERSION_MAJOR >= 55 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 35) if (frame) avcodec_free_frame(&frame); +#elif LIBAVCODEC_VERSION_MAJOR >= 54 || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 35) + if (frame) + av_free(frame); #endif return processed;