Skip to content
Snippets Groups Projects
Commit 3d9f49c2 authored by Alexandre Lision's avatar Alexandre Lision Committed by Guillaume Roguez
Browse files

mediadecoder: fix crash on hang up

introduced in 207f0d

avformat_close_input() does all the job and nullptr the given pointer.

Tuleap: #412
Change-Id: I3104d5dd66e3207d535dca332f8c9ce2463373a1
parent 5588d879
Branches
No related tags found
No related merge requests found
...@@ -48,17 +48,8 @@ MediaDecoder::~MediaDecoder() ...@@ -48,17 +48,8 @@ MediaDecoder::~MediaDecoder()
{ {
if (decoderCtx_) if (decoderCtx_)
avcodec_close(decoderCtx_); avcodec_close(decoderCtx_);
if (inputCtx_)
if (inputCtx_) { avformat_close_input(&inputCtx_);
if (inputCtx_->nb_streams > 0) {
#if LIBAVFORMAT_VERSION_CHECK(53, 17, 0, 25, 0)
avformat_close_input(&inputCtx_);
#else
av_close_input_file(inputCtx_);
#endif
}
avformat_free_context(inputCtx_);
}
av_dict_free(&options_); av_dict_free(&options_);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment