From: Steinar H. Gunderson Date: Tue, 19 Apr 2016 00:09:44 +0000 (+0200) Subject: Fix a threading issue during shutdown (two threads would try to encode audio at the... X-Git-Tag: 1.3.0~71 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=980a762aaa92d0b11e11415d95fea5a57e65a0ed;p=nageru Fix a threading issue during shutdown (two threads would try to encode audio at the same time). --- diff --git a/h264encode.cpp b/h264encode.cpp index 2692298..5f4ace9 100644 --- a/h264encode.cpp +++ b/h264encode.cpp @@ -2145,6 +2145,7 @@ void H264EncoderImpl::shutdown() storage_task_queue_changed.notify_all(); } storage_thread.join(); + encode_remaining_audio(); release_encode(); deinit_va(); @@ -2267,7 +2268,6 @@ void H264EncoderImpl::encode_thread_func() // but nobody else uses it at this point, since we're shutting down, // so there's no contention. encode_remaining_frames_as_p(encoding_frame_num, gop_start_display_frame_num, last_dts); - encode_remaining_audio(); return; } else { frame = move(pending_video_frames[display_frame_num]);