From: Steinar H. Gunderson Date: Mon, 26 Sep 2016 23:04:44 +0000 (+0200) Subject: Don't call avio_closep() unless we actually have an output file (e.g. in the stream... X-Git-Tag: 1.4.0~133 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f50d8a87fe399541b73c4e36ba2c78c4a8443447;p=nageru Don't call avio_closep() unless we actually have an output file (e.g. in the stream mux). --- diff --git a/mux.cpp b/mux.cpp index 2947cac..df974f0 100644 --- a/mux.cpp +++ b/mux.cpp @@ -94,7 +94,10 @@ Mux::Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const Mux::~Mux() { av_write_trailer(avctx); - avio_closep(&avctx->pb); + if (!(avctx->oformat->flags & AVFMT_NOFILE) && + !(avctx->flags & AVFMT_FLAG_CUSTOM_IO)) { + avio_closep(&avctx->pb); + } avformat_free_context(avctx); }