Commit 3d9f49c2 authored by Alexandre Lision's avatar Alexandre Lision Committed by Guillaume Roguez

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
......@@ -48,17 +48,8 @@ MediaDecoder::~MediaDecoder()
{
if (decoderCtx_)
avcodec_close(decoderCtx_);
if (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_);
}
if (inputCtx_)
avformat_close_input(&inputCtx_);
av_dict_free(&options_);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment