diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-08-08 16:25:39 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-08-10 23:56:35 +0200 |
commit | d53acf452f609b1235839ddb3d39ea377a965814 (patch) | |
tree | 3ea94f4eb2dde178967b646c1d9415ee7f9b56af /tests/ref/fate/matroska-dovi-write-config8 | |
parent | 59cb099478ee5293c7f3c00b3e2836e1f000f243 (diff) | |
download | ffmpeg-d53acf452f609b1235839ddb3d39ea377a965814.tar.gz |
avformat/matroskaenc: Don't write \0 unnecessarily
Writing the duration SimpleTag is special: It's size is
reserved in advance via an EBML Void element (if seekable)
and this reserved space is overwritten when writing the trailer;
it does not use put_ebml_string().
The string to write is created via snprintf on a buffer
of size 20; this buffer is then written via put_ebml_binary()
with a size of 20.
EBML strings need not be zero-terminated; if not, they
are implicitly terminated by the element's length field.
snprintf() always zero-terminates the buffer, i.e.
the last byte can be discarded when using an EBML string.
This patch does this.
The FATE changes are as expected: One byte saved for every
track; the only exception is the matroska-qt-mode test:
An additional byte is saved because an additional byte
could be saved from the enclosing Tags length field.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'tests/ref/fate/matroska-dovi-write-config8')
-rw-r--r-- | tests/ref/fate/matroska-dovi-write-config8 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ref/fate/matroska-dovi-write-config8 b/tests/ref/fate/matroska-dovi-write-config8 index de90101a55..55fe191047 100644 --- a/tests/ref/fate/matroska-dovi-write-config8 +++ b/tests/ref/fate/matroska-dovi-write-config8 @@ -1,5 +1,5 @@ -56eea905c35996a729371372dd3113f9 *tests/data/fate/matroska-dovi-write-config8.matroska -3600609 tests/data/fate/matroska-dovi-write-config8.matroska +0730145aa317d800cb4bde0e3a38bb8d *tests/data/fate/matroska-dovi-write-config8.matroska +3600607 tests/data/fate/matroska-dovi-write-config8.matroska #extradata 0: 551, 0xa18acf66 #extradata 1: 2, 0x00340022 #tb 0: 1/1000 |