Module: libav Branch: release/11 Commit: e679c5f9e6bbd5fd479a52b5072646478d126bf7
Author: Luca Barbato <[email protected]> Committer: Luca Barbato <[email protected]> Date: Mon Jun 15 20:40:46 2015 +0200 mov: Preserve the metadata even when bit-exactness is requested Make sure to not write the custom `encoder` string in that case. Bug-Id: 845 CC: [email protected] --- libavformat/movenc.c | 14 +++++++------- tests/ref/vsynth/vsynth1-mpeg4 | 4 ++-- tests/ref/vsynth/vsynth2-mpeg4 | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 8af3c34..e48a363 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1713,7 +1713,7 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, int ret, size; uint8_t *buf; - if (!st || mov->fc->flags & AVFMT_FLAG_BITEXACT) + if (!st) return 0; ret = avio_open_dyn_buf(&pb_buf); @@ -1991,8 +1991,10 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, mov_write_string_metadata(s, pb, "\251wrt", "composer" , 1); mov_write_string_metadata(s, pb, "\251alb", "album" , 1); mov_write_string_metadata(s, pb, "\251day", "date" , 1); - if (!mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 1)) - mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1); + if (!mov_write_string_metadata(s, pb, "\251too", "encoding_tool", 1)) { + if (!(s->flags & AVFMT_FLAG_BITEXACT)) + mov_write_string_tag(pb, "\251too", LIBAVFORMAT_IDENT, 0, 1); + } mov_write_string_metadata(s, pb, "\251cmt", "comment" , 1); mov_write_string_metadata(s, pb, "\251gen", "genre" , 1); mov_write_string_metadata(s, pb, "\251cpy", "copyright", 1); @@ -2095,9 +2097,6 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, int ret, size; uint8_t *buf; - if (s->flags & AVFMT_FLAG_BITEXACT) - return 0; - ret = avio_open_dyn_buf(&pb_buf); if (ret < 0) return ret; @@ -2117,7 +2116,8 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, mov_write_string_metadata(s, pb_buf, "\251aut", "author", 0); mov_write_string_metadata(s, pb_buf, "\251alb", "album", 0); mov_write_string_metadata(s, pb_buf, "\251day", "date", 0); - mov_write_string_metadata(s, pb_buf, "\251swr", "encoder", 0); + if (!(s->flags & AVFMT_FLAG_BITEXACT)) + mov_write_string_metadata(s, pb_buf, "\251swr", "encoder", 0); mov_write_string_metadata(s, pb_buf, "\251des", "comment", 0); mov_write_string_metadata(s, pb_buf, "\251gen", "genre", 0); mov_write_string_metadata(s, pb_buf, "\251cpy", "copyright", 0); diff --git a/tests/ref/vsynth/vsynth1-mpeg4 b/tests/ref/vsynth/vsynth1-mpeg4 index 38a7294..ac1ebc7 100644 --- a/tests/ref/vsynth/vsynth1-mpeg4 +++ b/tests/ref/vsynth/vsynth1-mpeg4 @@ -1,4 +1,4 @@ -dc927acd770e19a97456ecbd4d786938 *tests/data/fate/vsynth1-mpeg4.mp4 -540180 tests/data/fate/vsynth1-mpeg4.mp4 +173f524d5cd2591709bf1d5d2818b420 *tests/data/fate/vsynth1-mpeg4.mp4 +540241 tests/data/fate/vsynth1-mpeg4.mp4 8828a375448dc5c2215163ba70656f89 *tests/data/fate/vsynth1-mpeg4.out.rawvideo stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-mpeg4 b/tests/ref/vsynth/vsynth2-mpeg4 index 1aa75a8..bd47f14 100644 --- a/tests/ref/vsynth/vsynth2-mpeg4 +++ b/tests/ref/vsynth/vsynth2-mpeg4 @@ -1,4 +1,4 @@ -f60260ca447624a19ad8307abad7a431 *tests/data/fate/vsynth2-mpeg4.mp4 -159432 tests/data/fate/vsynth2-mpeg4.mp4 +5476cf4dc144eac67b12737fd8966641 *tests/data/fate/vsynth2-mpeg4.mp4 +159493 tests/data/fate/vsynth2-mpeg4.mp4 871fda3853f4766669ad875923920bd5 *tests/data/fate/vsynth2-mpeg4.out.rawvideo stddev: 6.02 PSNR: 32.53 MAXDIFF: 89 bytes: 7603200/ 7603200 _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
