ffmpeg/libav conditions for CodecID and AVCODEC_MAX_AUDIO_FRAME_SIZE (thanks @freultwah)

This commit is contained in:
ejurgensen 2014-01-27 21:24:08 +01:00
parent 6decdf4eaf
commit 785383861b
2 changed files with 11 additions and 1 deletions

View File

@ -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;

View File

@ -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 {