[FFmpeg-devel] [PATCH] avf:rmdec.c fill duration to AVFormatContext

William Yu genwillyu at gmail.com
Fri Jul 6 06:29:15 CEST 2012


I think rmdec should fill duration to AVFormatContext so that ffprobe
can check duration for rm file.

---
 libavformat/rmdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index d919a9a..901bcc8 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -475,7 +475,8 @@ static int rm_read_header(AVFormatContext *s)
             avio_rb32(pb); /* max packet size */
             avio_rb32(pb); /* avg packet size */
             avio_rb32(pb); /* nb packets */
-            avio_rb32(pb); /* duration */
+            duration = avio_rb32(pb); /* duration */
+            s->duration = av_rescale(duration, AV_TIME_BASE, 1000);
             avio_rb32(pb); /* preroll */
             indx_off = avio_rb32(pb); /* index offset */
             data_off = avio_rb32(pb); /* data offset */
-- 
1.7.11.1.59.gbc9e7dd


More information about the ffmpeg-devel mailing list