mov: Take stps entries into consideration also about key_off.
authorYusuke Nakamura <muken.the.vfrmaniac@gmail.com>
Fri, 13 Apr 2012 10:44:34 +0000 (19:44 +0900)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Sat, 21 Apr 2012 18:04:33 +0000 (14:04 -0400)
Splitted files don't start always from a sync sample.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
libavformat/mov.c

index 11b4582..a0c5393 100644 (file)
@@ -1754,7 +1754,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
         unsigned int stts_sample = 0;
         unsigned int sample_size;
         unsigned int distance = 0;
-        int key_off = sc->keyframes && sc->keyframes[0] == 1;
+        int key_off = (sc->keyframes && sc->keyframes[0] == 1) || (sc->stps_data && sc->stps_data[0] == 1);
 
         current_dts -= sc->dts_shift;