Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2022-03-03 00:25:43 +0300
committerRichard Antalik <richardantalik@gmail.com>2022-03-03 00:25:43 +0300
commitecba8c1243045e72c92f4575393821fc6bf2665f (patch)
treebefea163bce640392a83c7cac1bb71779301dd76 /source/blender/imbuf/intern/anim_movie.c
parentf531dff9b35120ef0ab0e6476f8a88f18b85609e (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.c5
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);