浏览代码

obs-ffmpeg: Fix deadlock on shutting down muxer

Exeldro 1 年之前
父节点
当前提交
9e7b51a585
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

+ 2 - 2
plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

@@ -686,10 +686,10 @@ static void *ffmpeg_mux_io_thread(void *data)
 
 		// Loop to write in chunk_size chunks
 		for (;;) {
-			shutting_down = os_atomic_load_bool(&ffm->io.shutdown_requested);
-
 			pthread_mutex_lock(&ffm->io.data_mutex);
 
+			shutting_down = os_atomic_load_bool(&ffm->io.shutdown_requested);
+
 			// Fetch as many writes as possible from the deque
 			// and fill up our local chunk. This may involve seeking
 			// if ffmpeg needs to, so take care of that as well.