summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-12-08 11:20:49 +0100
committerAnton Khirnov <anton@khirnov.net>2022-12-10 10:21:53 +0100
commit11cc3cedd39b45a7d3f06eb9c1bf4ce29cbfa433 (patch)
treef1c9ebbc88fd9182ffc61e0634aa64ded5cdf1ed
parentb5626ccea72d2ef81844cd44e7320e76cbde717a (diff)
lavfi/framesync: use a local variable to shorten code
-rw-r--r--libavfilter/framesync.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c
index ee91e4cf68..153db4fa21 100644
--- a/libavfilter/framesync.c
+++ b/libavfilter/framesync.c
@@ -201,24 +201,23 @@ static int framesync_advance(FFFrameSync *fs)
break;
}
for (i = 0; i < fs->nb_in; i++) {
- if (fs->in[i].pts_next == pts ||
- (fs->in[i].ts_mode == TS_NEAREST &&
- fs->in[i].have_next &&
- fs->in[i].pts_next != INT64_MAX && fs->in[i].pts != AV_NOPTS_VALUE &&
- fs->in[i].pts_next - pts < pts - fs->in[i].pts) ||
- (fs->in[i].before == EXT_INFINITY &&
- fs->in[i].state == STATE_BOF)) {
- av_frame_free(&fs->in[i].frame);
- fs->in[i].frame = fs->in[i].frame_next;
- fs->in[i].pts = fs->in[i].pts_next;
- fs->in[i].frame_next = NULL;
- fs->in[i].pts_next = AV_NOPTS_VALUE;
- fs->in[i].have_next = 0;
- fs->in[i].state = fs->in[i].frame ? STATE_RUN : STATE_EOF;
- if (fs->in[i].sync == fs->sync_level && fs->in[i].frame)
+ FFFrameSyncIn * const in = &fs->in[i];
+
+ if (in->pts_next == pts ||
+ (in->ts_mode == TS_NEAREST && in->have_next &&
+ in->pts_next != INT64_MAX && in->pts != AV_NOPTS_VALUE &&
+ in->pts_next - pts < pts - in->pts) ||
+ (in->before == EXT_INFINITY && in->state == STATE_BOF)) {
+ av_frame_free(&in->frame);
+ in->frame = in->frame_next;
+ in->pts = in->pts_next;
+ in->frame_next = NULL;
+ in->pts_next = AV_NOPTS_VALUE;
+ in->have_next = 0;
+ in->state = in->frame ? STATE_RUN : STATE_EOF;
+ if (in->sync == fs->sync_level && in->frame)
fs->frame_ready = 1;
- if (fs->in[i].state == STATE_EOF &&
- fs->in[i].after == EXT_STOP)
+ if (in->state == STATE_EOF && in->after == EXT_STOP)
framesync_eof(fs);
}
}