From c6890280588928b17de53507119d14544495abbf Mon Sep 17 00:00:00 2001 From: Jens Ziller Date: Tue, 2 Mar 2021 16:50:43 +0100 Subject: [PATCH] send packet only again if AVERROR(EAGAIN) --- codec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/codec.c b/codec.c index 5238867..041a739 100644 --- a/codec.c +++ b/codec.c @@ -272,7 +272,7 @@ void CodecVideoClose(VideoDecoder * decoder) */ int CodecVideoSendPacket(VideoDecoder * decoder, const AVPacket * avpkt) { - int ret; + int ret = AVERROR_DECODER_NOT_FOUND; #if 0 if (!decoder->VideoCtx->extradata_size) { @@ -319,9 +319,6 @@ int CodecVideoSendPacket(VideoDecoder * decoder, const AVPacket * avpkt) pthread_mutex_lock(&CodecLockMutex); if (decoder->VideoCtx) { ret = avcodec_send_packet(decoder->VideoCtx, avpkt); - } else { - pthread_mutex_unlock(&CodecLockMutex); - return 1; } pthread_mutex_unlock(&CodecLockMutex); #ifdef DEBUG