summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-02 17:46:09 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-19 01:03:05 +0200
commit81e39cf4814fac2acff92a3db586428dbf3b6892 (patch)
tree0f4fce8044114a2d4820f5afcaeb62045a05c05d /libavformat/matroskaenc.c
parent1779f0b12e112dfd993be1206a0891a47f9bf804 (diff)
downloadffmpeg-81e39cf4814fac2acff92a3db586428dbf3b6892.tar.gz
avformat/matroskaenc: Don't reserve space for duration when unseekable
We won't be able to seek back to write the actual duration anyway. FATE-tests using the md5pipe command had to be updated due to this change. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index ccbd73cbe4..10b64e2965 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1869,7 +1869,7 @@ static int mkv_write_header(AVFormatContext *s)
int64_t scaledDuration = av_rescale(metadata_duration, 1000, AV_TIME_BASE);
put_ebml_float(pb, MATROSKA_ID_DURATION, scaledDuration);
av_log(s, AV_LOG_DEBUG, "Write early duration from metadata = %" PRIu64 "\n", scaledDuration);
- } else {
+ } else if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
put_ebml_void(pb, 11); // assumes double-precision float to be written
}
}