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/8] fftools/ffmpeg: simplify ost_iter()
@ 2022-11-14 15:13 Anton Khirnov
  2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 2/8] fftools/ffmpeg_mux_init: move more code from of_open() to create_streams() Anton Khirnov
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Anton Khirnov @ 2022-11-14 15:13 UTC (permalink / raw)
  To: ffmpeg-devel

The inner loop never goes through more than 1 iteration, and so can be
replaced by an if().

Found-by: Andreas Rheinhardt
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index e6f6773f6a..0fa2fe8c52 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -612,7 +612,7 @@ static OutputStream *ost_iter(OutputStream *prev)
 
     for (; of_idx < nb_output_files; of_idx++) {
         OutputFile *of = output_files[of_idx];
-        for (; ost_idx < of->nb_streams; ost_idx++)
+        if (ost_idx < of->nb_streams)
             return of->streams[ost_idx];
 
         ost_idx = 0;
-- 
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] 9+ messages in thread

end of thread, other threads:[~2022-11-14 17:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 15:13 [FFmpeg-devel] [PATCH 1/8] fftools/ffmpeg: simplify ost_iter() Anton Khirnov
2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 2/8] fftools/ffmpeg_mux_init: move more code from of_open() to create_streams() Anton Khirnov
2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 3/8] fftools/ffmpeg: stop handling max_frames in do_video_out() Anton Khirnov
2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 4/8] fftools/ffmpeg: move OutputStream.max_frames to MuxStream Anton Khirnov
2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 5/8] fftools/ffmpeg_mux_init: move validating codec avoptions to a separate function Anton Khirnov
2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 6/8] fftools/ffmpeg_mux_init: do not call av{codec, format}_get_class() repeatedly Anton Khirnov
2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 7/8] fftools/ffmpeg_mux_init: use av_dict_iterate() where appropriate Anton Khirnov
2022-11-14 15:13 ` [FFmpeg-devel] [PATCH 8/8] fftools/ffmpeg_mux_init: drop an always-false check Anton Khirnov
2022-11-14 17:29 ` [FFmpeg-devel] [PATCH 1/8] fftools/ffmpeg: simplify ost_iter() Soft Works

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