Close decoder on stream ended

Add missing call to decoder_close().
This commit is contained in:
Romain Vimont 2019-06-26 23:50:39 +02:00
parent 056e47e752
commit 4961256123

View file

@ -198,7 +198,7 @@ run_stream(void *data) {
if (stream->recorder && !recorder_open(stream->recorder, codec)) { if (stream->recorder && !recorder_open(stream->recorder, codec)) {
LOGE("Could not open recorder"); LOGE("Could not open recorder");
goto finally_close_input; goto finally_close_decoder;
} }
AVPacket packet; AVPacket packet;
@ -248,6 +248,10 @@ quit:
if (stream->recorder) { if (stream->recorder) {
recorder_close(stream->recorder); recorder_close(stream->recorder);
} }
finally_close_decoder:
if (stream->decoder) {
decoder_close(stream->decoder);
}
finally_close_input: finally_close_input:
avformat_close_input(&format_ctx); avformat_close_input(&format_ctx);
finally_free_avio_ctx: finally_free_avio_ctx: