Skip to content

Commit b596596

Browse files
committed
fixing updateRecordingStatus not exiting when asked
1 parent c4a0dd3 commit b596596

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pyradio/player.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,14 +1130,20 @@ def updateRecordingStatus(self, *args):
11301130
if subsystemOut == '':
11311131
break
11321132
# logger.error('DE subsystemOut = "{0}"'.format(subsystemOut))
1133+
if stop():
1134+
break
11331135
with recording_lock:
11341136
tmp = self._is_accepted_input(subsystemOut)
11351137
if not tmp:
1138+
if stop():
1139+
break
11361140
continue
11371141
subsystemOut = subsystemOut.strip()
11381142
subsystemOut = subsystemOut.replace('\r', '').replace('\n', '')
11391143
# logger.error('DE subsystemOut = "{0}"'.format(subsystemOut))
11401144

1145+
if stop():
1146+
break
11411147
with recording_lock:
11421148
tmp = self.oldUserInput['Input']
11431149
if tmp != subsystemOut:
@@ -1148,14 +1154,20 @@ def updateRecordingStatus(self, *args):
11481154
else:
11491155
logger.debug('Monitor User input: {}'.format(subsystemOut))
11501156

1157+
if stop():
1158+
break
11511159
with recording_lock:
11521160
self.oldUserInput['Input'] = subsystemOut
11531161
self_volume_string = self.volume_string
11541162
self_player_name = self.PLAYER_NAME
1163+
if stop():
1164+
break
11551165
if self_volume_string in subsystemOut:
11561166
# disable volume for mpv
11571167
if self_player_name != 'mpv':
11581168
# logger.error('***** volume')
1169+
if stop():
1170+
break
11591171
with recording_lock:
11601172
if self.oldUserInput['Volume'] != subsystemOut:
11611173
self.oldUserInput['Volume'] = subsystemOut
@@ -1178,6 +1190,8 @@ def updateRecordingStatus(self, *args):
11781190
if self.show_volume and self.oldUserInput['Title']:
11791191
self.outputStream.write(msg=string_to_show, counter='')
11801192
self.threadUpdateTitle()
1193+
if stop():
1194+
break
11811195
except:
11821196
if logger.isEnabledFor(logging.ERROR):
11831197
logger.error('Error in updateRecordingStatus thread.', exc_info=True)

0 commit comments

Comments
 (0)