From 94c9bf8887ed58de16c8ecffca2bd216751a40ed Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Mon, 16 Apr 2012 23:27:45 +0900 Subject: [PATCH] mov: Treat keyframe indexes as 1-origin if starting at non-zero. Signed-off-by: Derek Buitenhuis --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index a0c5393396..747f062833 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -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) || (sc->stps_data && sc->stps_data[0] == 1); + int key_off = (sc->keyframes && sc->keyframes[0] > 0) || (sc->stps_data && sc->stps_data[0] > 0); current_dts -= sc->dts_shift;