Regression since 87f0c8280.

If the extradata of a stream could not be extracted correctly,
codec_info_nb_frames would remain zero, while st->event_flag would still
be marked as AVSTREAM_EVENT_FLAG_NEW_PACKETS.

The two expressions could be different in this case, hence reset
event_flags and calculate the correct score.

Fix #9029.

Signed-off-by: Linjie Fu <linjie.justin...@gmail.com>
---
 libavformat/utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 6f100294a1..de397a209e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3895,8 +3895,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
         }
         if (!st->internal->avctx->extradata) {
             ret = extract_extradata(st, pkt);
-            if (ret < 0)
+            if (ret < 0) {
+                st->event_flags = 0;
                 goto unref_then_goto_end;
+            }
         }
 
         /* If still no information, we try to open the codec and to
-- 
2.25.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-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to