From 6c578b9e4b7ae730f667992c23cd62bf6fa514c2 Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Thu, 11 Apr 2013 20:33:14 +0300 Subject: ff decoder: use AV_CODEC_ID_* where available --- src/combined/ffmpeg/ffmpeg_decoder.h | 4 ++++ src/combined/ffmpeg/mkcodeclist.pl | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/combined/ffmpeg/ffmpeg_decoder.h b/src/combined/ffmpeg/ffmpeg_decoder.h index ffa7de8df..b0185d50a 100644 --- a/src/combined/ffmpeg/ffmpeg_decoder.h +++ b/src/combined/ffmpeg/ffmpeg_decoder.h @@ -36,7 +36,11 @@ typedef struct ff_codec_s { uint32_t type; +#if defined LIBAVCODEC_VERSION_INT && LIBAVCODEC_VERSION_INT >= ((54<<16)|(25<<8)) + enum AVCodecID id; +#else enum CodecID id; +#endif const char *name; } ff_codec_t; diff --git a/src/combined/ffmpeg/mkcodeclist.pl b/src/combined/ffmpeg/mkcodeclist.pl index 311d147af..50632af4b 100755 --- a/src/combined/ffmpeg/mkcodeclist.pl +++ b/src/combined/ffmpeg/mkcodeclist.pl @@ -13,9 +13,13 @@ my $line; my %codecs; open LIST, "< $ffmpeg" or die $!; $line = ; +my $ff_prefix = 'CODEC_ID_'; +if (substr ($line, 0, 12) eq 'AV_CODEC_ID_') { + $ff_prefix = 'AV_CODEC_ID_'; +} while (defined $line) { chomp $line; - $line =~ s/^CODEC_ID_//o; + $line =~ s/^$ff_prefix//o; $codecs{$line} = 0; $line = ; } @@ -68,7 +72,7 @@ if ($w) { foreach $line (@known) { next if $line->[0] eq '!'; next unless defined $codecs{$line->[1]}; - print LIST " { BUF_${Type}_$line->[0], CODEC_ID_$line->[1], \"$line->[2] (ffmpeg)\" },\n" or die $!; + print LIST " { BUF_${Type}_$line->[0], $ff_prefix$line->[1], \"$line->[2] (ffmpeg)\" },\n" or die $!; } print LIST "};\n\nstatic uint32_t supported_${type}_types[] = {\n" or die $!; foreach $line (@known) { -- cgit v1.2.3