Skip to content

Commit 76f5796

Browse files
committed
output streams were disposed twice when closing a Muxer twice, but this should only ever happen once
1 parent 0c96cf3 commit 76f5796

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/ffmpeg-cpp/ffmpeg-cpp/Muxing/Muxer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ namespace ffmpegcpp
5252

5353
avformat_free_context(containerContext);
5454
containerContext = nullptr;
55+
56+
// when the container is closed, the related output streams are closed as well,
57+
// so we clean those up.
58+
outputStreams.clear();
5559
}
5660

5761
// clean up the queue
@@ -60,6 +64,7 @@ namespace ffmpegcpp
6064
AVPacket* tmp_pkt = packetQueue[i];
6165
av_packet_free(&tmp_pkt);
6266
}
67+
packetQueue.clear();
6368
}
6469

6570
void Muxer::AddOutputStream(OutputStream* outputStream)

0 commit comments

Comments
 (0)