diff mbox series

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

Message ID AM7PR03MB66608815D2F8B90A3073EC238F729@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 52a4d4404409af79ae0f5ed32d78386d43b19c84
Headers show
Series [FFmpeg-devel,01/12] avcodec/h2645_parse: Remove H2645NAL.rbsp_buffer | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 11, 2021, 6:40 p.m. UTC
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@outlook.com>
---
 libavformat/demux.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

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,