Skip to content

Commit ec0fcc7

Browse files
committed
fix(video): remove frame flushing on destruction to avoid segfault due to racecondition
1 parent c038302 commit ec0fcc7

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

src/video.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,6 @@ namespace video {
318318
avcodec_encode_session_t(avcodec_encode_session_t &&other) noexcept = default;
319319

320320
~avcodec_encode_session_t() {
321-
// Flush any remaining frames in the encoder
322-
if (avcodec_send_frame(avcodec_ctx.get(), nullptr) == 0) {
323-
packet_raw_avcodec pkt;
324-
while (avcodec_receive_packet(avcodec_ctx.get(), pkt.av_packet) == 0);
325-
}
326-
327321
// Order matters here because the context relies on the hwdevice still being valid
328322
avcodec_ctx.reset();
329323
device.reset();

0 commit comments

Comments
 (0)