[FFmpeg-devel] [PATCH 03/12] avformat/demux: Remove fake-loop

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat Dec 11 20:40:16 EET 2021


When flushing, try_decode_frame() itself loops until the desired
properties have been found or the decoder is drained.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavformat/demux.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 745dc8687c..87dbd53a0f 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -2771,11 +2771,9 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
 
             /* flush the decoders */
             if (sti->info->found_decoder == 1) {
-                do {
-                    err = try_decode_frame(ic, st, empty_pkt,
-                                            (options && i < orig_nb_streams)
-                                            ? &options[i] : NULL);
-                } while (err > 0 && !has_codec_parameters(st, NULL));
+                err = try_decode_frame(ic, st, empty_pkt,
+                                        (options && i < orig_nb_streams)
+                                        ? &options[i] : NULL);
 
                 if (err < 0) {
                     av_log(ic, AV_LOG_INFO,
-- 
2.32.0



More information about the ffmpeg-devel mailing list