-
Notifications
You must be signed in to change notification settings - Fork 93
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
Fix playback when skipping an in progress recording to real-time #413
Conversation
@FernetMenta what is your opinion on this? |
I've completed my testing using the tests outlined above, and all tests above passed successfully - now handles pauses correctly WRT setting IsRealTimeStream :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minors only.
@ksooo care to take another look? I don't expect these changes to have caused any regressions, but please don't merge until I've retested (tonight) just to be on the safe side. |
You have not (force-)pushed the changes so far. Cannot re-review. |
My apologies.... trying again |
Now ready for re-review ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost done, I'd say.
Latest changes pushed... still need to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Tell me, when you're done with your tests.
@ksooo I'm done with my testing, all working as expected. |
Here we go... thanks for your contribution. |
@@ -309,6 +312,12 @@ void SetSpeed(int speed) | |||
tvh->DemuxSpeed(speed); | |||
} | |||
|
|||
void PauseStream(bool paused) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using this function is wrong. you have to recalculate the conditions in read because player can run at lower speed, i.e. 0.8.
Description
This PR resolves issue #379: HTSPVFS and in progress recordings
Motivation and Context
Currently, if you skip right to the end of an in progress recording, then the playback completely chokes; i.e. both the audio and video break up badly, the video freezes, and the audio makes popping noises.
On debugging, I found that the main issue was that Tvheadend can briefly return 0 bytes when playing an in-progress recording towards EOF; the demuxer expects at least 1 bytes to be returned.
My PR resolves this issue by adjusting HTSPVFS::Read() to retry when 0 bytes are returned for an in-progress recording.
After fixing this problem, the other issue I found was that Kodi would buffer for around 10 seconds when skipping fwd to real-time, before eventually resuming normal playback. After some debugging and research I landed on the IsRealTimeStream API call. This PR returns true for IsRealTimeStream when playback is within the last 10 seconds of an in-progress recording.
How Has This Been Tested?
My testing was over a Gigabit Ethernet using both HD and SD channels.
Backend: TVheadend (v4.2.8) running on a 10yr old HTPC (Acer Revo 3700) running Debian Stretch
Kodi: Running on a Vero4K+ using OSMC Leia nightlies with pvr.hts v4.4.16 (+ this patch).
In this setup, I have conducted several tests as follows:
New tests added (16/04):