From 49612561233b3cde41339ee08c71892e42649706 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 26 Jun 2019 23:50:39 +0200 Subject: [PATCH] Close decoder on stream ended Add missing call to decoder_close(). --- app/src/stream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/stream.c b/app/src/stream.c index 30151859d9..e85834c173 100644 --- a/app/src/stream.c +++ b/app/src/stream.c @@ -198,7 +198,7 @@ run_stream(void *data) { if (stream->recorder && !recorder_open(stream->recorder, codec)) { LOGE("Could not open recorder"); - goto finally_close_input; + goto finally_close_decoder; } AVPacket packet; @@ -248,6 +248,10 @@ run_stream(void *data) { if (stream->recorder) { recorder_close(stream->recorder); } +finally_close_decoder: + if (stream->decoder) { + decoder_close(stream->decoder); + } finally_close_input: avformat_close_input(&format_ctx); finally_free_avio_ctx: