Skip to content

Commit

Permalink
[Navigation] playService, update forced evStart
Browse files Browse the repository at this point in the history
  • Loading branch information
Huevos committed Sep 7, 2024
1 parent b1bc227 commit b1d8ed5
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions lib/python/Navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,6 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust
return 0
InfoBarInstance = InfoBar.instance

# for iptv services force an evStart event immediately on zapping so the gui updates and the user doesn't feel like the box is frozen
if "%3a//" in ref.toString():
self.currentlyPlayingServiceReference = ref
self.currentlyPlayingServiceOrGroup = ref
self.originalPlayingServiceReference = ref

if InfoBarInstance:
InfoBarInstance.session.screen["CurrentService"].newService(ref)
InfoBarInstance.session.screen["Event_Now"].updateSource(ref)
InfoBarInstance.session.screen["Event_Next"].updateSource(ref)
InfoBarInstance.serviceStarted()

if not checkParentalControl or parentalControl.isServicePlayable(ref, boundFunction(self.playService, checkParentalControl=False, forceRestart=forceRestart, adjust=adjust)):
if ref.flags & eServiceReference.isGroup:
oldref = self.currentlyPlayingServiceReference or eServiceReference()
Expand Down Expand Up @@ -211,15 +199,23 @@ def playService(self, ref, checkParentalControl=True, forceRestart=False, adjust
self.retryServicePlayTimer = eTimer()
self.retryServicePlayTimer.callback.append(boundFunction(self.playService, ref, checkParentalControl, forceRestart, adjust))
self.retryServicePlayTimer.start(config.misc.softcam_streamrelay_delay.value, True)
elif self.pnav.playService(playref):
# print("[Navigation] Failed to start", playref)
self.currentlyPlayingServiceReference = None
self.currentlyPlayingServiceOrGroup = None
if oldref and "://" in oldref.getPath():
print("[Navigation] Streaming was active -> try again") # use timer to give the streamserver the time to deallocate the tuner
self.retryServicePlayTimer = eTimer()
self.retryServicePlayTimer.callback.append(boundFunction(self.playService, ref, checkParentalControl, forceRestart, adjust))
self.retryServicePlayTimer.start(500, True)
else:
if self.pnav.playService(playref):
# print("[Navigation] Failed to start", playref)
self.currentlyPlayingServiceReference = None
self.currentlyPlayingServiceOrGroup = None
if oldref and "://" in oldref.getPath():
print("[Navigation] Streaming was active -> try again") # use timer to give the streamserver the time to deallocate the tuner
self.retryServicePlayTimer = eTimer()
self.retryServicePlayTimer.callback.append(boundFunction(self.playService, ref, checkParentalControl, forceRestart, adjust))
self.retryServicePlayTimer.start(500, True)
else: # self.pnav.playService was successful so force evStart here immediately because that doesn't happen for iptv services so the box appears frozen
self.currentlyPlayingServiceOrGroup = self.currentlyPlayingServiceReference
if InfoBarInstance:
InfoBarInstance.session.screen["CurrentService"].newService(self.currentlyPlayingServiceReference)
InfoBarInstance.session.screen["Event_Now"].updateSource(self.currentlyPlayingServiceReference)
InfoBarInstance.session.screen["Event_Next"].updateSource(self.currentlyPlayingServiceReference)
InfoBarInstance.serviceStarted()
self.skipServiceReferenceReset = False
if setPriorityFrontend:
setPreferredTuner(int(config.usage.frontend_priority.value))
Expand Down

0 comments on commit b1d8ed5

Please sign in to comment.