diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-02-02 00:47:22 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-02-02 00:53:24 +0300 |
commit | 95fcb4184108aff91eb46f4192af5b0826e486a7 (patch) | |
tree | 74a34767305865ec860e8bc80cbd026335e2cf21 /source/blender/imbuf/intern/indexer.c | |
parent | a12265f0488fda1d67910a26293845ba5937c87e (diff) |
Fix T95378: Seek problems when timecodes are used
Function `IMB_indexer_get_seek_pos()` can return non 0 seek position for
frame index 0. This causes seeking to incorrect GOP and scanning ends
with failiure.
Hard-code first frame index seek position to 0.
Differential Revision: https://developer.blender.org/D13974
Diffstat (limited to 'source/blender/imbuf/intern/indexer.c')
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index a85ba65d014..00e96e7840b 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -247,8 +247,10 @@ struct anim_index *IMB_indexer_open(const char *name) uint64_t IMB_indexer_get_seek_pos(struct anim_index *idx, int frame_index) { - if (frame_index < 0) { - frame_index = 0; + /* This is hard coded, because our current timecode files return non zero seek position for index + * 0. Only when seeking to 0 it is guaranteed, that first packet will be read. */ + if (frame_index <= 0) { + return 0; } if (frame_index >= idx->num_entries) { frame_index = idx->num_entries - 1; |