# HG changeset patch # User michael # Date 1089752369 0 # Node ID abc8a657a8dd0b2017d784615343e21ab2d4bb04 # Parent 166b71445aecde4e5297306c8c8440a4566b9844 warn user if ms style codec tag is used remove " " codec tag diff -r 166b71445aec -r abc8a657a8dd movenc.c --- a/movenc.c Wed Jul 07 20:19:29 2004 +0000 +++ b/movenc.c Tue Jul 13 20:59:29 2004 +0000 @@ -252,7 +252,8 @@ static int mov_write_audio_tag(ByteIOContext *pb, MOVTrack* track) { - int pos = url_ftell(pb), tag; + int pos = url_ftell(pb); + int tag; put_be32(pb, 0); /* size */ @@ -261,13 +262,9 @@ if (!tag) { int tmp = codec_get_tag(codec_wav_tags, track->enc->codec_id); - if (tmp) - tag = MKTAG('m', 's', ((tmp >> 8) & 0xff), (tmp & 0xff)); + tag = MKTAG('m', 's', ((tmp >> 8) & 0xff), (tmp & 0xff)); } - if (!tag) - put_tag(pb, " "); - else - put_le32(pb, tag); // store it byteswapped + put_le32(pb, tag); // store it byteswapped put_be32(pb, 0); /* Reserved */ put_be16(pb, 0); /* Reserved */ @@ -442,7 +439,8 @@ static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track) { - int pos = url_ftell(pb), tag; + int pos = url_ftell(pb); + int tag; put_be32(pb, 0); /* size */ @@ -450,10 +448,7 @@ // if no mac fcc found, try with Microsoft tags if (!tag) tag = codec_get_tag(codec_bmp_tags, track->enc->codec_id); - if (!tag) - put_tag(pb, " "); - else - put_le32(pb, tag); // store it byteswapped + put_le32(pb, tag); // store it byteswapped put_be32(pb, 0); /* Reserved */ put_be16(pb, 0); /* Reserved */ @@ -930,6 +925,26 @@ MOVContext *mov = s->priv_data; int i; + for(i=0; inb_streams; i++){ + AVCodecContext *c= &s->streams[i]->codec; + + if (c->codec_type == CODEC_TYPE_VIDEO){ + if (!codec_get_tag(codec_movvideo_tags, c->codec_id)){ + if(!codec_get_tag(codec_bmp_tags, c->codec_id)) + return -1; + else + av_log(s, AV_LOG_INFO, "Warning, using MS style video codec tag, the file may be unplayable!\n"); + } + }else if(c->codec_type == CODEC_TYPE_AUDIO){ + if (!codec_get_tag(codec_movaudio_tags, c->codec_id)){ + if(!codec_get_tag(codec_wav_tags, c->codec_id)) + return -1; + else + av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, the file may be unplayable!\n"); + } + } + } + /* Default mode == MP4 */ mov->mode = MODE_MP4;