avformat/rpl: Calculate the duration of the video track
authorCameron Cawley <ccawley2011@gmail.com>
Sat, 29 Jun 2019 23:00:44 +0000 (00:00 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 5 Jul 2019 16:14:11 +0000 (18:14 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/rpl.c

index dbbcd13..17b45e3 100644 (file)
@@ -269,8 +269,10 @@ static int rpl_read_header(AVFormatContext *s)
         read_line_and_int(pb, &error);           //   (file index)
     error |= read_line(pb, line, sizeof(line));  // offset to "helpful" sprite
     error |= read_line(pb, line, sizeof(line));  // size of "helpful" sprite
-    if (vst)
+    if (vst) {
         error |= read_line(pb, line, sizeof(line));  // offset to key frame list
+        vst->duration = number_of_chunks * rpl->frames_per_chunk;
+    }
 
     // Read the index
     avio_seek(pb, chunk_catalog_offset, SEEK_SET);