[FFmpeg-cvslog] r20458 - trunk/libavformat/mov.c

bcoudurier subversion
Thu Nov 5 08:30:53 CET 2009


Author: bcoudurier
Date: Thu Nov  5 08:30:53 2009
New Revision: 20458

Log:
compute dts shift with ctts value, cslg atom might be missing, fix #419

Modified:
   trunk/libavformat/mov.c

Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c	Thu Nov  5 08:17:10 2009	(r20457)
+++ trunk/libavformat/mov.c	Thu Nov  5 08:30:53 2009	(r20458)
@@ -1362,29 +1362,6 @@ static int mov_read_stts(MOVContext *c, 
     return 0;
 }
 
-static int mov_read_cslg(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
-{
-    AVStream *st;
-    MOVStreamContext *sc;
-
-    if (c->fc->nb_streams < 1)
-        return 0;
-    st = c->fc->streams[c->fc->nb_streams-1];
-    sc = st->priv_data;
-
-    get_be32(pb); // version + flags
-
-    sc->dts_shift = get_be32(pb);
-    dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
-
-    get_be32(pb); // least dts to pts delta
-    get_be32(pb); // greatest dts to pts delta
-    get_be32(pb); // pts start
-    get_be32(pb); // pts end
-
-    return 0;
-}
-
 static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
@@ -1415,7 +1392,12 @@ static int mov_read_ctts(MOVContext *c, 
 
         sc->ctts_data[i].count   = count;
         sc->ctts_data[i].duration= duration;
+        if (duration < 0)
+            sc->dts_shift = FFMAX(sc->dts_shift, -duration);
     }
+
+    dprintf(c->fc, "dts shift %d\n", sc->shift);
+
     return 0;
 }
 
@@ -1978,7 +1960,6 @@ static int mov_read_elst(MOVContext *c, 
 static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('a','v','s','s'), mov_read_extradata },
 { MKTAG('c','o','6','4'), mov_read_stco },
-{ MKTAG('c','s','l','g'), mov_read_cslg },
 { MKTAG('c','t','t','s'), mov_read_ctts }, /* composition time to sample */
 { MKTAG('d','i','n','f'), mov_read_default },
 { MKTAG('d','r','e','f'), mov_read_dref },



More information about the ffmpeg-cvslog mailing list