diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-06-14 20:05:29 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-06-14 20:08:51 +0300 |
commit | 2e5671a959182dadcdd55117732082ab7893f3d1 (patch) | |
tree | 4567a162cecd2e3fa1ab87477e1c94508e3ccfa5 /source | |
parent | aadd3550289aa0258e9e99864bc6063d0dd03460 (diff) |
Fix: VSE seeking with proxy strips would fail on certain frames
If the last decoded frame had the same timestamp as the GOP current
packet, then we would skip over this frame when fast forwarding and we
would seek until the end of the file.
This would could only be triggered reliably in single threaded mode.
Reviewed By: Richard Antalik
Differential Revision: http://developer.blender.org/D11601
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 796f7469fb3..450c76630a8 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -1290,11 +1290,16 @@ static int ffmpeg_seek_to_key_frame(struct anim *anim, if (same_gop && position > anim->cur_position) { /* Change back to our old frame position so we can simply continue decoding from there. */ + int64_t cur_pts = timestamp_from_pts_or_dts(anim->cur_packet->pts, anim->cur_packet->dts); + + if (cur_pts == gop_pts) { + /* We are already at the correct position. */ + return 0; + } AVPacket *temp = av_packet_alloc(); + while (av_read_frame(anim->pFormatCtx, temp) >= 0) { int64_t temp_pts = timestamp_from_pts_or_dts(temp->pts, temp->dts); - int64_t cur_pts = timestamp_from_pts_or_dts(anim->cur_packet->pts, - anim->cur_packet->dts); if (temp->stream_index == anim->videoStream && temp_pts == cur_pts) { break; } |