summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-26 18:27:21 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-26 18:27:21 +0000
commit26846ba5151b0fe90e21c1a6beb9a3bcb569d1ac (patch)
tree744160441c399b843f5780201b64f165a40a6c75 /libavformat
parent221e21b70d4923ab0adb08a08ade15da68e265fb (diff)
support keyframes indexes starting at 0, broken files created by omneon, fix ref.mov seeking
Originally committed as revision 12242 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2e57915084..71ddc6ab26 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1389,6 +1389,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
unsigned int stts_sample = 0;
unsigned int keyframe, sample_size;
unsigned int distance = 0;
+ int key_off = sc->keyframes && sc->keyframes[0] == 1;
st->nb_frames = sc->sample_count;
for (i = 0; i < sc->chunk_count; i++) {
@@ -1401,7 +1402,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
av_log(mov->fc, AV_LOG_ERROR, "wrong sample count\n");
goto out;
}
- keyframe = !sc->keyframe_count || current_sample + 1 == sc->keyframes[stss_index];
+ keyframe = !sc->keyframe_count || current_sample+key_off == sc->keyframes[stss_index];
if (keyframe) {
distance = 0;
if (stss_index + 1 < sc->keyframe_count)