Skip to content

Commit

Permalink
ストリームを開始する際に既存のログがあれば削除するようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Apr 30, 2020
1 parent 6ea065a commit fcb61f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ function stream_start($stream, $ch, $sid, $tsid, $BonDriver, $quality, $encoder,
break;
}

// 既にTSTaskのログがあれば削除する
if (file_exists($base_dir.'logs/stream'.$stream.'.tstask.log')){
unlink($base_dir.'logs/stream'.$stream.'.tstask.log');
}

// TSTask.exeを起動する
$tstask_cmd = '"'.$tstask_path.'" '.($TSTask_window == 'true' ? '/xclient' : '/min /xclient-').' /udp /port '.$stream_port.' /sid '.$sid.' /tsid '.$tsid.
' /d '.$BonDriver.' /sendservice 1 /logfile '.$base_dir.'logs/stream'.$stream.'.tstask.log';
Expand Down Expand Up @@ -447,6 +452,10 @@ function stream_start($stream, $ch, $sid, $tsid, $BonDriver, $quality, $encoder,

// ログを書き出すかどうか
if ($encoder_log == 'true'){
// 既にエンコーダーのログがあれば削除する
if (file_exists($base_dir.'logs/stream'.$stream.'.encoder.log')){
unlink($base_dir.'logs/stream'.$stream.'.encoder.log');
}
$stream_cmd = 'start "'.$encoder.' Encoding..." '.($encoder_window == 'true' ? '' : '/B /min').' cmd.exe /C "'.win_exec_escape($stream_cmd).
' > '.$base_dir.'logs/stream'.$stream.'.encoder.log 2>&1"';
} else {
Expand Down

0 comments on commit fcb61f0

Please sign in to comment.