From f50d8a87fe399541b73c4e36ba2c78c4a8443447 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 27 Sep 2016 01:04:44 +0200 Subject: [PATCH] Don't call avio_closep() unless we actually have an output file (e.g. in the stream mux). --- mux.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.39.2