Comments (8)
Is tvheadend able to notify the client that the current position is at the end of the buffer? Or can the client detect it reliably? If so we could probably add a method to inform Kodi that it should stop fast forwarding and switch to normal playback speed.
from pvr.hts.
I doubt that the out-of-buffer state can be detected by client reliably, because there's always a delay for the request processing. TVH sends two messages when the out-of-buffer state occurs:
Basic example: pause to start timeshift, then play and fast-forward.. Kodi player tries to play at SPEED(200) after EOB until user forces standard SPEED(100) (standard play):
[ TRACE]:timeshift: ts 4 seek to 16485597 (fd 63) read msg (nil) (0) [ TRACE]:timeshift: ts 4 seek to 16485597 (fd 63) (incomplete) [ DEBUG]:timeshift: ts 4 skip 81584000 requested 7342560 [ DEBUG]:timeshift: ts 4 skip last_time 1232714136662 pts_delta 1232639678986 [ DEBUG]:timeshift: ts 4 skip to 1232721262986 from 1232714136662 [ DEBUG]:timeshift: ts 4 skip failed 1) [ DEBUG]:htsp: ::ffff:127.0.0.1 [ admin2 | Kodi Media Center ] - subscription skip 1) [ TRACE]:htsp-sub: ::ffff:127.0.0.1 [ admin2 | Kodi Media Center ] - subscription 4 '{"method":"subscriptionSkip","subscriptionId":4,"error":1}' [ DEBUG]:timeshift: ts 4 eob revert to live mode 2) [ DEBUG]:htsp: ::ffff:127.0.0.1 [ admin2 | Kodi Media Center ] - subscription speed 2) [ TRACE]:htsp-sub: ::ffff:127.0.0.1 [ admin2 | Kodi Media Center ] - subscription 4 '{"method":"subscriptionSpeed","subscriptionId":4,"speed":100}'
Analysis:
- TVH notifies that skip failed.. pvr.hts CHTSPDemuxer::ParseSubscriptionSkip sets INVALID_SEEKTIME so CHTSPDemuxer::Seek fails with false
- TVH notifies that the SPEED should be 100 (normal playback) ; CHTSPDemuxer::ParseSubscriptionSpeed does nothing
from pvr.hts.
You're right, we only log the requested speed in https://github.com/kodi-pvr/pvr.hts/blob/master/src/HTSPDemuxer.cpp#L514. So we should react on this and send a subscriptionSpeed
message back to the server? My only concern with this is that the Kodi player would be stuck in fast-forward state even though the playback speed may be back to normal. We need some way to trigger Kodi to stop fast forwarding.
@FernetMenta how would you propose we handle a situation like this? We'd need a new API method, right? But is it in your opinion okay for an addon to be able to control the player in this way?
from pvr.hts.
The speed was already changed on the server. The mentioned routine should control the player's speed to let users notify that the playing state / speed changed.
from pvr.hts.
Okay, I see now.
from pvr.hts.
@FernetMenta apparently we also need a way to tell Kodi to switch to "pause" when the user rewinds so far back that the timeshift buffer ends. At the moment it stalls and behaves weirdly until the user fast forwards a bit.
@perexg how instantly does Kodi have to react to these situations? I doubt the call to trigger the player to change can be done completely synchronously.
from pvr.hts.
There are no requirements from the TVH side, it's just about to break the bad requests from the player which does not make sense.
from pvr.hts.
Closing this since the proposed changes have been merged. Thanks @perexg for helping us out!
from pvr.hts.
Related Issues (20)
- pvr.hts segfaults - kodi 20.0-ALPHA1 (19.90.701) Git:20220701-30fb576edd HOT 8
- Too many status messages after long inactivity time HOT 3
- Kodi 19.4 (Nvidia Shield Pro) Audio Stutter and Buffering with TVHeadend Addon HOT 4
- Selecting a different video decoder HOT 2
- Kodi 20 Beta 1 & Nightlies - EPG Flush/Crash HOT 2
- Channel switch times HOT 3
- Feature request: Force software decoding for hts streams HOT 2
- Season 0 shows up as season 2 HOT 3
- Choppy audio only on bluetooth
- [issue] GUI is blocked when starting any live channel in Kodi Nexus HOT 8
- Live TV Subtitles broken on Kodi 20 HOT 1
- Cannot save settings on appletv HOT 3
- Live TV HEVC streams not playing-Ubuntu 22.04 lts Kodi Nexus HOT 22
- listitem.size doesn't update in real time HOT 1
- Channel Groups/Tags not syncing between tvheadend and Kodi HOT 1
- Feature Request: Warn when creating an overlapping recording HOT 3
- Disconnect from TVHeadend server while playing piped mpd-stream with "demux read no data for at least 10 secs" HOT 6
- [tvOS] Addon settings not saved
- Live TV HEVC streams not playing-Libreelec Intel generic HOT 6
- cstdint needs to be included in HTSPVFS.h HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pvr.hts.