[vlma-devel] commit: Provide different command-line arguments according to the version of VLC which is run . (Adrien Grand )
git version control
git at videolan.org
Tue Mar 10 02:22:58 CET 2009
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Sat Mar 7 21:49:52 2009 +0100| [239c72e8f93309757aabceae18db5f871a95a70c] | committer: Adrien Grand
Provide different command-line arguments according to the version of VLC which is run.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=239c72e8f93309757aabceae18db5f871a95a70c
---
vlma-watchdog/src/conf.py | 9 ++++++++-
vlma-watchdog/src/vlc.py | 5 +++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/vlma-watchdog/src/conf.py b/vlma-watchdog/src/conf.py
index e07b023..9abf317 100644
--- a/vlma-watchdog/src/conf.py
+++ b/vlma-watchdog/src/conf.py
@@ -6,7 +6,13 @@ LOG_LEVEL = 20
# Name of the VLC executable (give the full path if vlc is not
# available in the PATH environment variable)
VLC_EXE = "vlc"
-VLC_ARGS = "--color -vvv --ignore-config --rtsp-host 0.0.0.0:5554 --intf lua --lua-intf telnet"
+def get_VLC_ARGS(version):
+ if version.find(" 0.8.") >= 0:
+ # VLC 0.8.x
+ return "-vvv --rtsp-host 0.0.0.0:5554 --intf telnet"
+ else:
+ # VLC 0.9 and higher
+ return "-vvv --ignore-config --rtsp-host 0.0.0.0:5554 --intf lua --lua-intf telnet"
CPU_LOAD_THRESHOLD = 6.0
VLC_CPU_THRESHOLD = 80.0
@@ -21,3 +27,4 @@ SERVER_PASSWORD = "admin"
# Size of the log queue to keep in memory
LOG_TAIL_SIZE = 500
+
diff --git a/vlma-watchdog/src/vlc.py b/vlma-watchdog/src/vlc.py
index c0da896..a106f20 100644
--- a/vlma-watchdog/src/vlc.py
+++ b/vlma-watchdog/src/vlc.py
@@ -35,8 +35,9 @@ class VLCRunner(threading.Thread):
if not self.__shouldRun:
break
self.version = None
- self.logger.info("Running %s %s", conf.VLC_EXE, conf.VLC_ARGS)
- args = conf.VLC_ARGS.split()
+ vlc_args = conf.get_VLC_ARGS(self.getVersion())
+ self.logger.info("Running %s %s", conf.VLC_EXE, vlc_args)
+ args = vlc_args.split()
args.insert(0, conf.VLC_EXE)
self.__startTime = math.floor(1000L * time.time())
process = subprocess.Popen(args, bufsize=8192, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
More information about the vlma-devel
mailing list