From 890ba131b0ff63d98c7b77310344798000f2b7dc Mon Sep 17 00:00:00 2001 From: Nicolas Corrarello Date: Sat, 17 Jun 2023 10:48:27 +0100 Subject: [PATCH] Added parameter to configure remote commands delay after starting stream Replace tabs with spaces --- config.ini | 3 +++ slingbox_server.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.ini b/config.ini index 61500d7..e7c79ba 100644 --- a/config.ini +++ b/config.ini @@ -53,6 +53,9 @@ password=YourSlingboxPassword ; 2 or 3 for M2 hardware causes it to reboot. VideoSource = 1 +;Configure delay before sending remote commands after starting the stream (when using ?channel=xx). Your mileage may vary on this. Defaults to 10 seconds. +;RemoteDelay = 10.0 + [SERVER] ;local port number for the server to listen on for connections port=8080 diff --git a/slingbox_server.py b/slingbox_server.py index 359c575..ed662ad 100755 --- a/slingbox_server.py +++ b/slingbox_server.py @@ -807,6 +807,7 @@ def RemoteLocked(sender_ip): print('name, Bad E1: Password Missing characters') continue + remotedelay = float(slinginfo.get('RemoteDelay', 10.0)) resolution = int(slinginfo.get('Resolution', 12 )) if resolution < 0 or resolution > 16 : print(name, 'Invalid Resolution', resolution, 'Defaulting to 640x480') @@ -943,7 +944,7 @@ def RemoteLocked(sender_ip): if socket_ready : s_ctl.recv(8192) if StartChannel : - if curtime - startchanneltime > 10.0 : + if curtime - startchanneltime > remotedelay : StartChannel = send_start_channel(StartChannel, rccode)