1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
FFmpeg/tests/ref/fate/matroska-mpegts-remux
Andreas Rheinhardt d53acf452f 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>
2023-08-10 23:56:35 +02:00

61 lines
1.7 KiB
Plaintext

52e030428110a8c1b74c03c7ad31a6ca *tests/data/fate/matroska-mpegts-remux.matroska
6500 tests/data/fate/matroska-mpegts-remux.matroska
#tb 0: 1/1000
#media_type 0: audio
#codec_id 0: ac3
#sample_rate 0: 48000
#channel_layout_name 0: stereo
#tb 1: 1/1000
#media_type 1: audio
#codec_id 1: ac3
#sample_rate 1: 48000
#channel_layout_name 1: stereo
0, 0, 0, 32, 768, 0xa63778d4
1, 0, 0, 32, 768, 0xa63778d4
0, 32, 32, 32, 768, 0x7d577f3f
1, 32, 32, 32, 768, 0x7d577f3f
0, 64, 64, 32, 768, 0xd86b7c8f
1, 64, 64, 32, 768, 0xd86b7c8f
0, 96, 96, 32, 626, 0x09f4382f
1, 96, 96, 32, 626, 0x09f4382f
[STREAM]
index=0
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=1
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
[/STREAM]
[STREAM]
index=1
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=1
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
[/STREAM]