]> git.sesse.net Git - ffmpeg/commitdiff
remove now useless codec_tag setting code in muxers
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 21 Jan 2007 12:44:58 +0000 (12:44 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 21 Jan 2007 12:44:58 +0000 (12:44 +0000)
Originally committed as revision 7603 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/aiff.c
libavformat/asf-enc.c
libavformat/au.c
libavformat/flvenc.c
libavformat/riff.c

index 8fa61948be7ceabd951ddd1b6435e848b796932a..10eb1d1f4b33ad6e9aae206767e90c48f5af1cf1 100644 (file)
@@ -165,7 +165,6 @@ static int aiff_write_header(AVFormatContext *s)
     AVExtFloat sample_rate;
 
     /* First verify if format is ok */
-    enc->codec_tag = codec_get_tag(codec_aiff_tags, enc->codec_id);
     if (!enc->codec_tag) {
         av_free(aiff);
         return -1;
index d12b52ad38a4a7a254a24d29e5cf731b71138724..e87d5288f765541a8bb03659070d00d3967cc5bb 100644 (file)
@@ -458,15 +458,11 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
         /* id */
         if (enc->codec_type == CODEC_TYPE_AUDIO) {
             put_le16(pb, 2);
-            if(!enc->codec_tag)
-                enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id);
             if(!enc->codec_tag)
                 return -1;
             put_le16(pb, enc->codec_tag);
         } else {
             put_le16(pb, 4);
-            if(!enc->codec_tag)
-                enc->codec_tag = codec_get_tag(codec_bmp_tags, enc->codec_id);
             if(!enc->codec_tag)
                 return -1;
             put_le32(pb, enc->codec_tag);
index 4bd8b1e25388bdcf478e07ae67cd64c465cf7243..6326de6f512afa6e73e8c961d3ca6fceecd90479 100644 (file)
@@ -46,8 +46,6 @@ static const AVCodecTag codec_au_tags[] = {
 /* AUDIO_FILE header */
 static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
 {
-    if(!enc->codec_tag)
-       enc->codec_tag = codec_get_tag(codec_au_tags, enc->codec_id);
     if(!enc->codec_tag)
         return -1;
     put_tag(pb, ".snd");       /* magic number */
index e5879675957436e2431ae3e67b3a147aaaaf5064..8fc36b9c96223e3b490218e9d6cd6e619ec727c4 100644 (file)
@@ -145,7 +145,7 @@ static int flv_write_header(AVFormatContext *s)
             }
             flv->hasVideo=1;
 
-            videocodecid = codec_get_tag(flv_video_codec_ids, enc->codec_id);
+            videocodecid = enc->codec_tag;
             if(videocodecid == 0) {
                 av_log(enc, AV_LOG_ERROR, "video codec not compatible with flv\n");
                 return -1;
@@ -155,7 +155,7 @@ static int flv_write_header(AVFormatContext *s)
             samplerate = enc->sample_rate;
             channels = enc->channels;
 
-            audiocodecid = codec_get_tag(flv_audio_codec_ids, enc->codec_id);
+            audiocodecid = enc->codec_tag;
             samplesize = (enc->codec_id == CODEC_ID_PCM_S8) ? 8 : 16;
 
             if(get_audio_flags(enc)<0)
@@ -282,7 +282,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
     if (enc->codec_type == CODEC_TYPE_VIDEO) {
         put_byte(pb, FLV_TAG_TYPE_VIDEO);
 
-        flags = codec_get_tag(flv_video_codec_ids, enc->codec_id);
+        flags = enc->codec_tag;
         if(flags == 0) {
             av_log(enc, AV_LOG_ERROR, "video codec %X not compatible with flv\n",enc->codec_id);
             return -1;
index 08371a3aeb5ff075bb9ef470d3e45232ce39b26d..7a7f7cd0a61ffec8d01ec8546bf9d0d42b55d2d0 100644 (file)
@@ -295,8 +295,6 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
     int bps, blkalign, bytespersec;
     int hdrsize = 18;
 
-    if(!enc->codec_tag || enc->codec_tag > 0xffff)
-       enc->codec_tag = codec_get_tag(codec_wav_tags, enc->codec_id);
     if(!enc->codec_tag || enc->codec_tag > 0xffff)
         return -1;
 
@@ -387,7 +385,7 @@ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *ta
 
     put_le16(pb, enc->bits_per_sample ? enc->bits_per_sample : 24); /* depth */
     /* compression type */
-    put_le32(pb, for_asf ? (enc->codec_tag ? enc->codec_tag : av_codec_get_tag(asf_muxer.codec_tag, enc->codec_id)) : enc->codec_tag); //
+    put_le32(pb, enc->codec_tag);
     put_le32(pb, enc->width * enc->height * 3);
     put_le32(pb, 0);
     put_le32(pb, 0);