summaryrefslogtreecommitdiff
path: root/doc/muxers.texi
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-12-30 16:28:39 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-04-02 19:22:51 +0200
commit06f108907d75bae89a568eda02e188a91deb4ec9 (patch)
tree09975a06e79ede6ba7ff350f856cce1cc7f011d0 /doc/muxers.texi
parent8e1354c95d05a64bf5b99317387fca0ebdb4cd41 (diff)
downloadffmpeg-06f108907d75bae89a568eda02e188a91deb4ec9.tar.gz
avformat/matroskaenc: Don't fail if reserved Cues space doesn't suffice
When the user opted to write the Cues at the beginning, the Cues were simply written without checking in advance whether enough space has been reserved for them. If it wasn't enough, the data following the space reserved for the Cues was simply overwritten, corrupting the file. This commit changes this by checking whether enough space has been reserved for the Cues before outputting anything. If it isn't enough, no Cues will be output at all and the file will be finalized normally, yet writing the trailer will nevertheless return an error to notify the user that his wish of having Cues at the front of the file hasn't been fulfilled. This change opens new usecases for this option: It is now safe to use this option to e.g. record live streams or to use it when muxing the output of an expensive encoding, because when the reserved space turns out to be insufficient, one ends up with a file that just lacks Cues but is otherwise fine. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'doc/muxers.texi')
-rw-r--r--doc/muxers.texi5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/muxers.texi b/doc/muxers.texi
index d304181671..3be1c89416 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -1352,8 +1352,9 @@ index at the beginning of the file.
If this option is set to a non-zero value, the muxer will reserve a given amount
of space in the file header and then try to write the cues there when the muxing
-finishes. If the available space does not suffice, muxing will fail. A safe size
-for most use cases should be about 50kB per hour of video.
+finishes. If the reserved space does not suffice, no Cues will be written, the
+file will be finalized and writing the trailer will return an error.
+A safe size for most use cases should be about 50kB per hour of video.
Note that cues are only written if the output is seekable and this option will
have no effect if it is not.