Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
Merge pull request #10 from flizzy420/master
Browse files Browse the repository at this point in the history
thread name 改為 pid,支援多開
  • Loading branch information
lingkai5wu authored Jun 11, 2023
2 parents 05aaf8a + 986af77 commit f7e63e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/ThreadUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def start_audio_control_threads(self):
sessions = get_all_audio_sessions()
for session in sessions:
process_name = session.Process.name()
if process_name in self.config_util.config["processes"] and process_name not in alive_process:
self.logger.info(f"Found target process: {process_name}")
if process_name in self.config_util.config["processes"] and str(session.ProcessId) not in alive_process:
self.logger.info(f"Found target process: {process_name} (PID: {session.ProcessId})")
audio_util = AudioUtil(session, self.config_util, self.event, self.logger)
thread = threading.Thread(target=audio_util.loop, name=process_name)
thread = threading.Thread(target=audio_util.loop, name=session.ProcessId)
thread.start()

def background_scanner(self):
Expand Down

0 comments on commit f7e63e3

Please sign in to comment.