diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-04-29 17:40:57 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-05-18 20:34:03 +0200 |
commit | 0ba5299a805e9ccaef1a757381fc2ada4d54b8a1 (patch) | |
tree | c1eb41ce0d7d58ffd6bca42575a0dc79c9c98e19 /libavformat/movenc.c | |
parent | 6656370b858329ca07a60a2de954d5e90daa0206 (diff) | |
download | ffmpeg-0ba5299a805e9ccaef1a757381fc2ada4d54b8a1.tar.gz |
movenc: use the "encoder" metadata tag to write stsd Compressorname
This mirrors the demuxer behaviour and avoids accessing
AVCodecContext.codec, which should not be done in muxers.
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 9087438998..cf0158be52 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1003,6 +1003,7 @@ static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track) static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track) { + AVDictionaryEntry *encoder; int64_t pos = avio_tell(pb); char compressor_name[32] = { 0 }; @@ -1036,8 +1037,9 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track) avio_wb16(pb, 1); /* Frame count (= 1) */ /* FIXME not sure, ISO 14496-1 draft where it shall be set to 0 */ - if (track->mode == MODE_MOV && track->enc->codec && track->enc->codec->name) - av_strlcpy(compressor_name, track->enc->codec->name, 32); + if (track->mode == MODE_MOV && + (encoder = av_dict_get(track->st->metadata, "encoder", NULL, 0))) + av_strlcpy(compressor_name, encoder->value, 32); avio_w8(pb, strlen(compressor_name)); avio_write(pb, compressor_name, 31); @@ -3366,6 +3368,7 @@ static int mov_write_header(AVFormatContext *s) MOVTrack *track= &mov->tracks[i]; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0); + track->st = st; track->enc = st->codec; track->language = ff_mov_iso639_to_lang(lang?lang->value:"und", mov->mode!=MODE_MOV); if (track->language < 0) |