mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-23 01:16:18 +00:00
Transcoding supbprocess error handling
This commit is contained in:
parent
45f60aaedb
commit
4c68bac189
13
api/media.py
13
api/media.py
@ -60,11 +60,14 @@ def stream_media():
|
|||||||
return request.error_formatter(0, 'No way to transcode from {} to {}'.format(src_suffix, dst_suffix))
|
return request.error_formatter(0, 'No way to transcode from {} to {}'.format(src_suffix, dst_suffix))
|
||||||
|
|
||||||
transcoder, decoder, encoder = map(lambda x: prepare_transcoding_cmdline(x, res.path, src_suffix, dst_suffix, dst_bitrate), [ transcoder, decoder, encoder ])
|
transcoder, decoder, encoder = map(lambda x: prepare_transcoding_cmdline(x, res.path, src_suffix, dst_suffix, dst_bitrate), [ transcoder, decoder, encoder ])
|
||||||
if transcoder:
|
try:
|
||||||
proc = subprocess.Popen(transcoder, stdout = subprocess.PIPE)
|
if transcoder:
|
||||||
else:
|
proc = subprocess.Popen(transcoder, stdout = subprocess.PIPE)
|
||||||
dec_proc = subprocess.Popen(decoder, stdout = subprocess.PIPE)
|
else:
|
||||||
proc = subprocess.Popen(encoder, stdin = dec_proc.stdout, stdout = subprocess.PIPE)
|
dec_proc = subprocess.Popen(decoder, stdout = subprocess.PIPE)
|
||||||
|
proc = subprocess.Popen(encoder, stdin = dec_proc.stdout, stdout = subprocess.PIPE)
|
||||||
|
except:
|
||||||
|
return request.error_formatter(0, 'Error while running the transcoding process')
|
||||||
|
|
||||||
def transcode():
|
def transcode():
|
||||||
while True:
|
while True:
|
||||||
|
Loading…
Reference in New Issue
Block a user