X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mux.cpp;fp=mux.cpp;h=df974f0644520aa7c31ffb757abe1b733af2e480;hb=f50d8a87fe399541b73c4e36ba2c78c4a8443447;hp=2947cac82ab519bdddb22e9bab1862805f80658e;hpb=3372c3c549a92e9bd904220e324d31422dc22303;p=nageru 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); }