[FFmpeg-devel] [PATCH] libavformat/matroskaenc.c: Check if we can seek before writing the end of the ebml of the segment.

Thierry Foucu tfoucu at gmail.com
Tue Mar 10 18:26:16 EET 2020


---
 libavformat/matroskaenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 42f21eae8b..cf436f9e3e 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -2630,7 +2630,7 @@ static int mkv_write_trailer(AVFormatContext *s)
         avio_seek(pb, currentpos, SEEK_SET);
     }
 
-    if (!mkv->is_live) {
+    if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live) {
         end_ebml_master(pb, mkv->segment);
     }
 
-- 
2.25.1.481.gfbce0eb801-goog



More information about the ffmpeg-devel mailing list