diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-03-03 00:25:43 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2022-04-11 01:30:29 +0300 |
commit | d9aa221cce17d9df614e193e0c635eead279062b (patch) | |
tree | db1863ae861daad762d5712de1622fa06339170a /source/blender/imbuf/intern/anim_movie.c | |
parent | d9aa45a984bf5aa9adc92b3af3a1075210aca642 (diff) |
Fix mistake in seeking cleanup
In `ffmpeg_read_video_frame` fix assignment used as truth value.
In `ffmpeg_seek_recover_stream_position` loop while return value is
greater or equal to 0.
Diffstat (limited to 'source/blender/imbuf/intern/anim_movie.c')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index f97a50ecf47..7cde49f44b7 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -870,11 +870,12 @@ static void ffmpeg_decode_store_frame_pts(struct anim *anim) static int ffmpeg_read_video_frame(struct anim *anim, AVPacket *packet) { int ret = 0; - while (ret = av_read_frame(anim->pFormatCtx, packet) >= 0) { + while ((ret = av_read_frame(anim->pFormatCtx, packet)) >= 0) { if (packet->stream_index == anim->videoStream) { break; } } + return ret; } @@ -1174,7 +1175,7 @@ static int ffmpeg_generic_seek_workaround(struct anim *anim, static void ffmpeg_seek_recover_stream_position(struct anim *anim) { AVPacket *temp_packet = av_packet_alloc(); - while (ffmpeg_read_video_frame(anim, temp_packet)) { + while (ffmpeg_read_video_frame(anim, temp_packet) >= 0) { int64_t current_pts = timestamp_from_pts_or_dts(anim->cur_packet->pts, anim->cur_packet->dts); int64_t temp_pts = timestamp_from_pts_or_dts(temp_packet->pts, temp_packet->dts); av_packet_unref(temp_packet); |