Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTSPDemuxer: don't disconnect when demux read no data #634

Closed
wants to merge 1 commit into from

Conversation

smp79
Copy link

@smp79 smp79 commented Nov 14, 2023

I had this very annoying issue - when watching an encrypted TV channel and descrambling would fail (for whatever reason, eg network problem) - I got a frozen video until I switch to another channel. "Restart on error" is enabled in tvh htsp profile but in that case it was useless because pvr.hts would close the connection and I end up with a frozen video even when descrambling is available again.

This PR fix that issue. Now when descrambling temporarily fails - the subscription would stay alive and streaming is resumed automatically, "Restart on error" tvh setting now works as it should.

With this PR:

2023-11-14 07:12:28.318 descrambler: cannot decode packets for service "Eurosport 1 NEE HD"
2023-11-14 07:12:29.914 subscription: 0004: service instance is bad, reason: No access
2023-11-14 07:14:04.272 subscription: 0004: restarting channel Eurosport 1 NEE HD
2023-11-14 07:14:06.214 mpegts: 10723V in Discovery Networks - tuning on STV090x Multistandard #0 : DVB-S #0

Without this PR:

2023-11-14 07:21:16.752 descrambler: cannot decode packets for service "Eurosport 1 NEE HD"
2023-11-14 07:21:18.086 subscription: 0001: service instance is bad, reason: No access
2023-11-14 07:21:20.086 subscription: 0001: restarting channel Eurosport 1 NEE HD
2023-11-14 07:21:20.183 htsp: 127.0.0.1 [  | Kodi Media Center ]: Disconnected
2023-11-14 07:21:20.183 subscription: 0001: "127.0.0.1 [  | Kodi Media Center ]" unsubscribing from "Eurosport 1 NEE HD", hostname="127.0.0.1", username="127.0.0.1", client="Kodi Media Center"

@lrusak lrusak requested a review from ksooo November 14, 2023 05:50
@Jalle19
Copy link
Contributor

Jalle19 commented Nov 14, 2023

The code in question was added to fix something else, I'm on the phone now so hard ro look it up.

@ksooo
Copy link
Member

ksooo commented Nov 14, 2023

The removed code was added exactly to fix frozen video in Kodi for the case kodi having connection problems with tvheadend, for example not getting any data from tvh for 10 secs. So simply deleting this code is definitely not the solution as it re-introduces other issues.

@ksooo
Copy link
Member

ksooo commented Nov 14, 2023

The idea (and it was tested working) at that time was that pvr.hts reconnects automatically after the disconnect. If this does not work anymore, we need to investigate and fix this.

@ksooo
Copy link
Member

ksooo commented Nov 14, 2023

@smp79 It seems recent pvr.hts update (20.6.4/21.1.1) broke the automatic reconnect. Have you tested with one of these recent versions and encountered the issue with one of those? If yes, could you downgrade to 20.6.3/21.1.0 and test whether all is working without your patch?

@smp79
Copy link
Author

smp79 commented Nov 14, 2023

It seems recent pvr.hts update (20.6.4/21.1.1) broke the automatic reconnect.

You are right. No issue with 20.6.3

The idea (and it was tested working) at that time was that pvr.hts reconnects automatically after the disconnect.

I tested 2a5b57a and it is indeed a nice improvement. If tvh is restarted during stream, pvr.hts automatically reconnects. We definitely don't want to revert this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants