Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/4] lavfi/framesync: use a local variable to shorten code
@ 2023-01-27 13:16 Anton Khirnov
  2023-01-27 13:16 ` [FFmpeg-devel] [PATCH 2/4] lavfi/framesync: reorder functions to avoid a forward declaration Anton Khirnov
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Anton Khirnov @ 2023-01-27 13:16 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libavfilter/framesync.c | 33 ++++++++++++++++-----------------
 1 file 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);
             }
         }
-- 
2.35.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-01-30 11:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 13:16 [FFmpeg-devel] [PATCH 1/4] lavfi/framesync: use a local variable to shorten code Anton Khirnov
2023-01-27 13:16 ` [FFmpeg-devel] [PATCH 2/4] lavfi/framesync: reorder functions to avoid a forward declaration Anton Khirnov
2023-01-27 14:47   ` Nicolas George
2023-01-27 13:16 ` [FFmpeg-devel] [PATCH 3/4] lavfi/framesync: add syncing via external timestamp map Anton Khirnov
2023-01-27 13:22   ` Paul B Mahol
2023-01-27 14:53   ` Nicolas George
2023-01-27 16:45     ` Anton Khirnov
2023-01-30 11:01       ` Nicolas George
2023-01-27 13:16 ` [FFmpeg-devel] [PATCH 4/4] lavfi/framesync: reindent after previous commit Anton Khirnov
2023-01-27 14:39 ` [FFmpeg-devel] [PATCH 1/4] lavfi/framesync: use a local variable to shorten code Nicolas George

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git