Wait for STDOUT in VLC for non-Windows systems (to resolve#125 reported by blaenk)
This commit is contained in:
parent
8f3c855d44
commit
fde8c05117
@ -54,7 +54,6 @@ DO_NOT_RESET_POSITION_THRESHOLD = 1.0
|
|||||||
SYNC_ON_PAUSE = True # Client seek to global position - subtitles may disappear on some media players
|
SYNC_ON_PAUSE = True # Client seek to global position - subtitles may disappear on some media players
|
||||||
PLAYLIST_MAX_CHARACTERS = 10000
|
PLAYLIST_MAX_CHARACTERS = 10000
|
||||||
PLAYLIST_MAX_ITEMS = 250
|
PLAYLIST_MAX_ITEMS = 250
|
||||||
VLC_LISTEN_FOR_STDOUT = False # Changing to True this could break VLC 3 on Windows
|
|
||||||
|
|
||||||
# Options for the File Switch feature:
|
# Options for the File Switch feature:
|
||||||
FOLDER_SEARCH_FIRST_FILE_TIMEOUT = 15.0 # Secs - How long to wait to find the first file in folder search (to take account of HDD spin up)
|
FOLDER_SEARCH_FIRST_FILE_TIMEOUT = 15.0 # Secs - How long to wait to find the first file in folder search (to take account of HDD spin up)
|
||||||
|
|||||||
@ -362,7 +362,7 @@ class VlcPlayer(BasePlayer):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
self.__process = subprocess.Popen(call, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
self.__process = subprocess.Popen(call, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||||
if constants.VLC_LISTEN_FOR_STDOUT:
|
if self._shouldListenForSTDOUT():
|
||||||
for line in iter(self.__process.stderr.readline, ''):
|
for line in iter(self.__process.stderr.readline, ''):
|
||||||
self.vlcHasResponded = True
|
self.vlcHasResponded = True
|
||||||
if "[syncplay]" in line:
|
if "[syncplay]" in line:
|
||||||
@ -386,6 +386,12 @@ class VlcPlayer(BasePlayer):
|
|||||||
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
self._sendingData = threading.Lock()
|
self._sendingData = threading.Lock()
|
||||||
|
|
||||||
|
def _shouldListenForSTDOUT(self):
|
||||||
|
if sys.platform.startswith('win'):
|
||||||
|
return False # Due to VLC3 not using STDOUT/STDERR
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
def initiate_send(self):
|
def initiate_send(self):
|
||||||
with self._sendingData:
|
with self._sendingData:
|
||||||
asynchat.async_chat.initiate_send(self)
|
asynchat.async_chat.initiate_send(self)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user