For fragmented files, st->duration is used for setting dts on all
packets in later fragments. In those cases, after parsing the moov
atom, st->duration should be the duration of all samples described
within the moov, not the duration of the complete file.

For some ismv files, the mdhd duration is the total duration of the
files, not only the duration of the samples in the moov atom
(which doesn't contain any samples at all).

This fixes part of bug 215.
---
 libavformat/mov.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8723695..a83ffe4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -747,7 +747,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
     mov_metadata_creation_time(&st->metadata, creation_time);
 
     sc->time_scale = avio_rb32(pb);
-    st->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration 
*/
+    (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
 
     lang = avio_rb16(pb); /* language */
     if (ff_mov_lang_to_iso639(lang, language))
-- 
1.7.3.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to