player: Close ffmpeg stdin during streaming
A `stdin` of `None` means the ffmpeg subprocess input inherits from the parent process, which may cause undesired control from a terminal (e.g. `C` causes ffmpeg to prompt for a command). It also closes the parent's stdin when the subprocess exits. This commit switches to `subprocess.DEVNULL`, which provides a separate pre-closed stdin for ffmpeg subprocesses.
This commit is contained in:
parent
755ab28311
commit
017591dc9e
@ -203,7 +203,7 @@ class FFmpegPCMAudio(FFmpegAudio):
|
|||||||
|
|
||||||
def __init__(self, source, *, executable='ffmpeg', pipe=False, stderr=None, before_options=None, options=None):
|
def __init__(self, source, *, executable='ffmpeg', pipe=False, stderr=None, before_options=None, options=None):
|
||||||
args = []
|
args = []
|
||||||
subprocess_kwargs = {'stdin': source if pipe else None, 'stderr': stderr}
|
subprocess_kwargs = {'stdin': source if pipe else subprocess.DEVNULL, 'stderr': stderr}
|
||||||
|
|
||||||
if isinstance(before_options, str):
|
if isinstance(before_options, str):
|
||||||
args.extend(shlex.split(before_options))
|
args.extend(shlex.split(before_options))
|
||||||
@ -293,7 +293,7 @@ class FFmpegOpusAudio(FFmpegAudio):
|
|||||||
pipe=False, stderr=None, before_options=None, options=None):
|
pipe=False, stderr=None, before_options=None, options=None):
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
subprocess_kwargs = {'stdin': source if pipe else None, 'stderr': stderr}
|
subprocess_kwargs = {'stdin': source if pipe else subprocess.DEVNULL, 'stderr': stderr}
|
||||||
|
|
||||||
if isinstance(before_options, str):
|
if isinstance(before_options, str):
|
||||||
args.extend(shlex.split(before_options))
|
args.extend(shlex.split(before_options))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user