avformat/evcdec: simplify au_end_found check

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2023-06-17 22:18:14 -03:00
parent ca8a660176
commit 5a2ff43384
1 changed files with 3 additions and 6 deletions

View File

@ -182,7 +182,7 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
{ {
int ret; int ret;
int32_t nalu_size; int32_t nalu_size;
int au_end_found; int au_end_found = 0;
EVCDemuxContext *const c = s->priv_data; EVCDemuxContext *const c = s->priv_data;
@ -192,8 +192,6 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR_EOF; return AVERROR_EOF;
} }
au_end_found = 0;
while(!au_end_found) { while(!au_end_found) {
uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE]; uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE];
@ -229,9 +227,8 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_ERROR, "evc_frame_merge filter failed to " av_log(s, AV_LOG_ERROR, "evc_frame_merge filter failed to "
"send output packet\n"); "send output packet\n");
au_end_found = 1; if (ret != AVERROR(EAGAIN))
if (ret == AVERROR(EAGAIN)) au_end_found = 1;
au_end_found = 0;
} }
return ret; return ret;