Commit fc9a23ed authored by bcoudurier's avatar bcoudurier

support keyframes indexes starting at 0, broken files created by omneon, fix ref.mov seeking

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@12242 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9d915360
...@@ -1389,6 +1389,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) ...@@ -1389,6 +1389,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
unsigned int stts_sample = 0; unsigned int stts_sample = 0;
unsigned int keyframe, sample_size; unsigned int keyframe, sample_size;
unsigned int distance = 0; unsigned int distance = 0;
int key_off = sc->keyframes && sc->keyframes[0] == 1;
st->nb_frames = sc->sample_count; st->nb_frames = sc->sample_count;
for (i = 0; i < sc->chunk_count; i++) { for (i = 0; i < sc->chunk_count; i++) {
...@@ -1401,7 +1402,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) ...@@ -1401,7 +1402,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
av_log(mov->fc, AV_LOG_ERROR, "wrong sample count\n"); av_log(mov->fc, AV_LOG_ERROR, "wrong sample count\n");
goto out; 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) { if (keyframe) {
distance = 0; distance = 0;
if (stss_index + 1 < sc->keyframe_count) if (stss_index + 1 < sc->keyframe_count)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment