mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 01:39:28 +02:00
Move process kill to stream function
This commit is contained in:
parent
422d4bf260
commit
d53527378b
4 changed files with 20 additions and 18 deletions
|
@ -678,20 +678,7 @@ if ($bytes_streamed < $stream_size && (connection_status() == 0)) {
|
|||
if ($transcode && isset($transcoder)) {
|
||||
fclose($fp);
|
||||
|
||||
function kill($pid){
|
||||
return stripos(php_uname('s'), 'win')>-1 ? exec("taskkill /F /T /PID $pid") : exec("kill -9 $pid");
|
||||
}
|
||||
|
||||
$status = proc_get_status($transcoder['process']);
|
||||
if($status['running'] == true)
|
||||
{
|
||||
$pid = $status['pid'];
|
||||
debug_event('play', 'Stream process about to be killed. pid:'.$pid, 1);
|
||||
|
||||
kill($pid);
|
||||
|
||||
proc_close($transcoder['process']);
|
||||
}
|
||||
Stream::kill_process($transcoder);
|
||||
} else {
|
||||
fclose($fp);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue