diff mbox series

[FFmpeg-devel,14/17] avformat/evcdec: simplify au_end_found check

Message ID 20230618234332.1370-4-jamrial@gmail.com
State Accepted
Commit 5a2ff4338444b87248e838061214f3d72f1e8447
Headers show
Series [FFmpeg-devel,1/3] avcodec/evc_frame_merge: use av_fast_realloc() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

James Almer June 18, 2023, 11:43 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/evcdec.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/evcdec.c b/libavformat/evcdec.c
index 7a783e9809..a3a41cb4a5 100644
--- a/libavformat/evcdec.c
+++ b/libavformat/evcdec.c
@@ -144,7 +144,7 @@  static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     int ret;
     int32_t nalu_size;
-    int au_end_found;
+    int au_end_found = 0;
 
     EVCDemuxContext *const c = s->priv_data;
 
@@ -154,8 +154,6 @@  static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
         return AVERROR_EOF;
     }
 
-    au_end_found = 0;
-
     while(!au_end_found) {
 
         uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE];
@@ -191,9 +189,8 @@  static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
             av_log(s, AV_LOG_ERROR, "evc_frame_merge filter failed to "
                    "send output packet\n");
 
-        au_end_found = 1;
-        if (ret == AVERROR(EAGAIN))
-            au_end_found = 0;
+        if (ret != AVERROR(EAGAIN))
+            au_end_found = 1;
     }
 
     return ret;