diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-04-01 11:30:22 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-04-01 11:45:53 +0300 |
commit | 6fe2d6b8c8ebd9566d27b92a890cc4fc1e7d5d1e (patch) | |
tree | 88f63b15174d5235c788433a9c574eb9370283ea /source/blender/imbuf | |
parent | a9fc5be5fa4cad5b12dfbed8ef3babaada96ab2a (diff) |
Fix freezed proxy frames
`ffmpeg_generic_seek_workaround()` applied negative offset for seqrched
packet timestamp, but proxies always start from 0 and timestamp can be
negative.
Limit timestamp value to 0, because `av_seek_frame()` doesn't accept
negative timestamps and returns with error. This prevents seeking from
working correctly.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index dc39af803e0..1d14f7567c4 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -1140,6 +1140,7 @@ static int ffmpeg_generic_seek_workaround(struct anim *anim, int64_t requested_p * small. */ for (int offset = 5; offset < 25; offset++) { current_pos = requested_pos - ((int64_t)(offset)*AV_TIME_BASE / frame_rate); + current_pos = max_ii(current_pos, 0); /* Seek to timestamp. */ if (av_seek_frame(anim->pFormatCtx, -1, current_pos, AVSEEK_FLAG_BACKWARD) < 0) { |