diff libmpdemux/demux_lavf.c @ 21966:d9494ca70ca7

Simplify by using av_codec_get_id and include riff.h only in demux_lavf.c
author reimar
date Sun, 21 Jan 2007 15:44:58 +0000
parents b60906a5ab6e
children f615c862f862
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sun Jan 21 11:10:52 2007 +0000
+++ b/libmpdemux/demux_lavf.c	Sun Jan 21 15:44:58 2007 +0000
@@ -67,7 +67,7 @@
 
 int64_t ff_gcd(int64_t a, int64_t b);
 
-const AVCodecTag mp_wav_tags[] = {
+static const AVCodecTag mp_wav_tags[] = {
     { CODEC_ID_ADPCM_4XM,         MKTAG('4', 'X', 'M', 'A')},
     { CODEC_ID_ADPCM_EA,          MKTAG('A', 'D', 'E', 'A')},
     { CODEC_ID_ADPCM_IMA_WS,      MKTAG('A', 'I', 'W', 'S')},
@@ -86,7 +86,9 @@
     { 0, 0 },
 };
 
-const AVCodecTag mp_bmp_tags[] = {
+const struct AVCodecTag *mp_wav_taglists[] = {codec_wav_tags, mp_wav_tags, 0};
+
+static const AVCodecTag mp_bmp_tags[] = {
     { CODEC_ID_DSICINVIDEO,       MKTAG('D', 'C', 'I', 'V')},
     { CODEC_ID_FLIC,              MKTAG('F', 'L', 'I', 'C')},
     { CODEC_ID_IDCIN,             MKTAG('I', 'D', 'C', 'I')},
@@ -99,6 +101,8 @@
     { 0, 0 },
 };
 
+const struct AVCodecTag *mp_bmp_taglists[] = {codec_bmp_tags, mp_bmp_tags, 0};
+
 static int mp_open(URLContext *h, const char *filename, int flags){
     return 0;
 }
@@ -252,9 +256,7 @@
             priv->astreams[priv->audio_streams] = i;
             priv->audio_streams++;
             if(!codec->codec_tag)
-                codec->codec_tag= codec_get_wav_tag(codec->codec_id);
-            if(!codec->codec_tag)
-                codec->codec_tag= codec_get_tag(mp_wav_tags, codec->codec_id);
+                codec->codec_tag= av_codec_get_tag(mp_wav_taglists, codec->codec_id);
             wf->wFormatTag= codec->codec_tag;
             wf->nChannels= codec->channels;
             wf->nSamplesPerSec= codec->sample_rate;
@@ -326,9 +328,7 @@
             bih=calloc(sizeof(BITMAPINFOHEADER) + codec->extradata_size,1);
 
             if(!codec->codec_tag)
-                codec->codec_tag= codec_get_bmp_tag(codec->codec_id);
-            if(!codec->codec_tag)
-                codec->codec_tag= codec_get_tag(mp_bmp_tags, codec->codec_id);
+                codec->codec_tag= av_codec_get_tag(mp_bmp_taglists, codec->codec_id);
             bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size;
             bih->biWidth= codec->width;
             bih->biHeight= codec->height;