Discussion:
[PATCH] fix compile error for new versions of ffmpeg
Johannes Weißl
2011-05-27 01:22:37 UTC
Permalink
Sorry, too late for 2.4.1, but shouldn't affect too many users.
---
ffmpeg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index aa57b65..cd62c14 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -38,6 +38,10 @@
# define NUM_FFMPEG_KEYS 8
#endif

+#if (LIBAVCODEC_VERSION_INT < ((52<<16)+(64<<8)+0))
+# define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
+#endif
+
#if (LIBAVCODEC_VERSION_INT < ((52<<16)+(94<<8)+1))
#define AV_SAMPLE_FMT_U8 SAMPLE_FMT_U8
#define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
@@ -185,7 +189,7 @@ static int ffmpeg_open(struct input_plugin_data *ip_data)

for (i = 0; i < ic->nb_streams; i++) {
cc = ic->streams[i]->codec;
- if (cc->codec_type == CODEC_TYPE_AUDIO) {
+ if (cc->codec_type == AVMEDIA_TYPE_AUDIO) {
stream_index = i;
break;
}
--
1.7.5.1
Loading...