# HG changeset patch # User Mathieu Schroeter # Date 1314609729 -7200 # Node ID 804a298afa60f18558db4c87b8027a535b594650 # Parent 70494a8fd3f563a4c026e60d5b7344bb572b3797 ffmpeg: use only AVMEDIA_ instead of CODEC_ in the implementation files; prefer a define for the older versions of ffmpeg diff -r 70494a8fd3f5 -r 804a298afa60 src/grabber_ffmpeg.c --- a/src/grabber_ffmpeg.c Wed Aug 17 09:34:22 2011 +0200 +++ b/src/grabber_ffmpeg.c Mon Aug 29 11:22:09 2011 +0200 @@ -89,11 +89,7 @@ switch (codec->codec_type) { -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) case AVMEDIA_TYPE_AUDIO: -#else - case CODEC_TYPE_AUDIO: -#endif audio_streams++; name = grabber_ffmpeg_codec_name (codec->codec_id); if (name) @@ -107,11 +103,7 @@ VALHALLA_METADATA_AUDIO_BITRATE, ffmpeg->pl); break; -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) case AVMEDIA_TYPE_VIDEO: -#else - case CODEC_TYPE_VIDEO: -#endif /* Common part (image + video) */ video_streams++; name = grabber_ffmpeg_codec_name (codec->codec_id); @@ -146,11 +138,7 @@ VALHALLA_METADATA_VIDEO_ASPECT, ffmpeg->pl); break; -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) case AVMEDIA_TYPE_SUBTITLE: -#else - case CODEC_TYPE_SUBTITLE: -#endif sub_streams++; break; diff -r 70494a8fd3f5 -r 804a298afa60 src/lavf_utils.h --- a/src/lavf_utils.h Wed Aug 17 09:34:22 2011 +0200 +++ b/src/lavf_utils.h Mon Aug 29 11:22:09 2011 +0200 @@ -22,6 +22,12 @@ #ifndef VALHALLA_LAVF_UTILS #define VALHALLA_LAVF_UTILS +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0) +#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO +#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO +#define AVMEDIA_TYPE_SUBTITLE CODEC_TYPE_SUBTITLE +#endif /* LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0) */ + const char *vh_lavf_utils_fmtname_get (const char *suffix); AVFormatContext *vh_lavf_utils_open_input_file (const char *file); diff -r 70494a8fd3f5 -r 804a298afa60 src/parser.c --- a/src/parser.c Wed Aug 17 09:34:22 2011 +0200 +++ b/src/parser.c Mon Aug 29 11:22:09 2011 +0200 @@ -343,21 +343,9 @@ for (i = 0; i < ctx->nb_streams; i++) { AVStream *st = ctx->streams[i]; - if (st->codec->codec_type == -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) - AVMEDIA_TYPE_VIDEO -#else - CODEC_TYPE_VIDEO -#endif - ) + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) video_st = 1; - else if (st->codec->codec_type == -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) - AVMEDIA_TYPE_AUDIO -#else - CODEC_TYPE_AUDIO -#endif - ) + else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) audio_st = 1; }