From 785383861b76224ee04388b380f07415c764a460 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 27 Jan 2014 21:24:08 +0100 Subject: [PATCH] ffmpeg/libav conditions for CodecID and AVCODEC_MAX_AUDIO_FRAME_SIZE (thanks @freultwah) --- src/filescanner_ffmpeg.c | 6 ++++++ src/transcode.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/filescanner_ffmpeg.c b/src/filescanner_ffmpeg.c index cb04dd1a..1e4ace65 100644 --- a/src/filescanner_ffmpeg.c +++ b/src/filescanner_ffmpeg.c @@ -318,9 +318,15 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi) { AVFormatContext *ctx; const struct metadata_map *extra_md_map; +#if LIBAVCODEC_VERSION_MAJOR >= 55 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 35) + enum AVCodecID codec_id; + enum AVCodecID video_codec_id; + enum AVCodecID audio_codec_id; +#else enum CodecID codec_id; enum CodecID video_codec_id; enum CodecID audio_codec_id; +#endif AVStream *video_stream; AVStream *audio_stream; int mdcount; diff --git a/src/transcode.c b/src/transcode.c index f8931a6f..62f1a626 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -55,7 +55,11 @@ #include "transcode.h" -#define XCODE_BUFFER_SIZE ((AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2) +#if LIBAVCODEC_VERSION_MAJOR >= 56 || (LIBAVCODEC_VERSION_MAJOR == 55 && LIBAVCODEC_VERSION_MINOR >= 18) +# define XCODE_BUFFER_SIZE ((192000 * 3) / 2) +#else +# define XCODE_BUFFER_SIZE ((AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2) +#endif struct transcode_ctx {