Skip to content

Commit

Permalink
Close decoder on stream ended
Browse files Browse the repository at this point in the history
Add missing call to decoder_close().
  • Loading branch information
rom1v committed Jun 26, 2019
1 parent 056e47e commit 4961256
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4961256

Please sign in to comment.