[MPlayer-cvslog] r21984 - in trunk: libmpcodecs/ae_lavc.c libmpdemux/demux_lavf.c libmpdemux/muxer_lavf.c

reimar subversion at mplayerhq.hu
Sun Jan 21 16:44:58 CET 2007


Author: reimar
Date: Sun Jan 21 16:44:58 2007
New Revision: 21984

Modified:
   trunk/libmpcodecs/ae_lavc.c
   trunk/libmpdemux/demux_lavf.c
   trunk/libmpdemux/muxer_lavf.c

Log:
Simplify by using av_codec_get_id and include riff.h only in demux_lavf.c


Modified: trunk/libmpcodecs/ae_lavc.c
==============================================================================
--- trunk/libmpcodecs/ae_lavc.c	(original)
+++ trunk/libmpcodecs/ae_lavc.c	Sun Jan 21 16:44:58 2007
@@ -31,12 +31,10 @@
 #if defined(USE_LIBAVFORMAT) ||  defined(USE_LIBAVFORMAT_SO)
 #ifdef USE_LIBAVFORMAT_SO
 #include <ffmpeg/avformat.h>
-#include <ffmpeg/riff.h>
 #else
 #include "libavformat/avformat.h"
-#include "libavformat/riff.h"
 #endif
-extern const AVCodecTag mp_wav_tags[];
+extern const struct AVCodecTag *mp_wav_taglists[];
 #endif
 
 static int bind_lavc(audio_encoder_t *encoder, muxer_stream_t *mux_a)
@@ -182,9 +180,7 @@
 	if(lavc_param_atag == 0)
 	{
 #if defined(USE_LIBAVFORMAT) ||  defined(USE_LIBAVFORMAT_SO)
-		lavc_param_atag = codec_get_wav_tag(lavc_acodec->id);
-                if(!lavc_param_atag)
-                        lavc_param_atag =  codec_get_tag(mp_wav_tags, lavc_acodec->id);
+		lavc_param_atag = av_codec_get_tag(mp_wav_taglists, lavc_acodec->id);
 #else
 		lavc_param_atag = lavc_find_atag(lavc_param_acodec);
 #endif

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	(original)
+++ trunk/libmpdemux/demux_lavf.c	Sun Jan 21 16:44:58 2007
@@ -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;

Modified: trunk/libmpdemux/muxer_lavf.c
==============================================================================
--- trunk/libmpdemux/muxer_lavf.c	(original)
+++ trunk/libmpdemux/muxer_lavf.c	Sun Jan 21 16:44:58 2007
@@ -22,9 +22,9 @@
 #else
 #include "avformat.h"
 #endif
-#include "libavformat/riff.h"
 
-extern const AVCodecTag mp_wav_tags[];
+extern const struct AVCodecTag *mp_wav_taglists[];
+extern const struct AVCodecTag *mp_bmp_taglists[];
 
 extern char *info_name;
 extern char *info_artist;
@@ -207,9 +207,7 @@
 
 	if(stream->type == MUXER_TYPE_AUDIO)
 	{
-		ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag); 
-                if(!ctx->codec_id)
-                        ctx->codec_id = codec_get_id(mp_wav_tags, stream->wf->wFormatTag);
+		ctx->codec_id = av_codec_get_id(mp_wav_taglists, stream->wf->wFormatTag); 
 #if 0 //breaks aac in mov at least
 		ctx->codec_tag = codec_get_wav_tag(ctx->codec_id);
 #endif
@@ -238,7 +236,7 @@
 	}
 	else if(stream->type == MUXER_TYPE_VIDEO)
 	{
-		ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression);
+		ctx->codec_id = av_codec_get_id(mp_bmp_taglists, stream->bih->biCompression);
                 if(ctx->codec_id <= 0 || force_fourcc)
                     ctx->codec_tag= stream->bih->biCompression;
 		mp_msg(MSGT_MUXER, MSGL_INFO, "VIDEO CODEC ID: %d\n", ctx->codec_id);



More information about the MPlayer-cvslog mailing list