summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2013-04-11 20:33:14 +0300
committerTorsten Jager <t.jager@gmx.de>2013-04-11 20:33:14 +0300
commit6c578b9e4b7ae730f667992c23cd62bf6fa514c2 (patch)
tree9c89dc2a0342acb798e6b62888862f48d5206aea
parent6da7eb9805657660cc51f75fcd8e2720c03ec1e8 (diff)
downloadxine-lib-6c578b9e4b7ae730f667992c23cd62bf6fa514c2.tar.gz
xine-lib-6c578b9e4b7ae730f667992c23cd62bf6fa514c2.tar.bz2
ff decoder: use AV_CODEC_ID_* where available
-rw-r--r--src/combined/ffmpeg/ffmpeg_decoder.h4
-rwxr-xr-xsrc/combined/ffmpeg/mkcodeclist.pl8
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 = <LIST>;
+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 = <LIST>;
}
@@ -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) {