From 804891e1d08db585b0dbfb67ddae9e9e6b564442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Fri, 14 Jul 2017 15:04:21 +0200 Subject: [PATCH] Simplify video killing as it does not work --- soundboard.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/soundboard.py b/soundboard.py index 5ab2961..76e5956 100644 --- a/soundboard.py +++ b/soundboard.py @@ -41,17 +41,12 @@ def index(sound=None, text=None, video=None): if video is not None: url = subprocess.check_output(["youtube-dl", "-g", "-f", "mp4", video]).decode() - audioproc = subprocess.Popen(["omxplayer", url.split("\n")[1]]) - videoproc = subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]]) - - processlist.append(audioproc) - processlist.append(videoproc) + subprocess.Popen(["omxplayer", url.split("\n")[1]]) + subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]]) killvideo = request.args.get("killvideo") if killvideo is not None and killvideo in ["1", "true", "yes"]: - for process in processlist: - process.terminate() - processlist.remove(process) + subprocess.Popen(["pkill", "-f", "omxplayer"]) return render_template("index.html", sounds=sounds)