diff --git a/app/src/decoder.c b/app/src/decoder.c index 68c1c500..94dc9401 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -92,10 +92,6 @@ static int run_decoder(void *data) { packet.size = 0; while (!av_read_frame(format_ctx, &packet)) { - if (avio_ctx->eof_reached) { - av_packet_unref(&packet); - goto run_quit; - } // the new decoding/encoding API has been introduced by: // #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 37, 0) @@ -129,6 +125,10 @@ static int run_decoder(void *data) { } #endif av_packet_unref(&packet); + + if (avio_ctx->eof_reached) { + break; + } } LOGD("End of frames");