Fix issue2246
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 9 Mar 2011 16:03:09 +0000 (17:03 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Apr 2011 14:40:12 +0000 (16:40 +0200)
ignore last ctts duration
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mov.c

index 60dbbfca2eb4fc35ef876fcb7dc0e4ec4397d503..c08b07e55d7a48e719ceeca25cc164e7820e3ae9 100644 (file)
@@ -1499,7 +1499,7 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 
         sc->ctts_data[i].count   = count;
         sc->ctts_data[i].duration= duration;
 
         sc->ctts_data[i].count   = count;
         sc->ctts_data[i].duration= duration;
-        if (duration < 0)
+        if (duration < 0 && i+1<entries)
             sc->dts_shift = FFMAX(sc->dts_shift, -duration);
     }
 
             sc->dts_shift = FFMAX(sc->dts_shift, -duration);
     }