IsRealTimeStream callback -- Does not do what I expect.
#1
When playing live TV, I return `true` from the PVR callback IsRealTimeStream.  For some time now, this has not been working as expected, and I am at a loss as to why.  This has had me stumped for weeks.

I expect that when `true` is returned, that Kodi will attempt to exhaust the stream, and control the playback speed so as to not overrun the input and stall, or the other way, buffer in the sender.  But it's not working.  After changing a channel, Kodi plays a few seconds then buffers.  And for some channels, the playback will fall behind real time, as much as 15 or 20 minutes over 8 hours.

How can I debug this situation?  I have ensured that IsRealTimeStream is indeed being called (quite often in fact) and that I am returning `true`.  What next?
Reply
#2
Please open a github issue and ping FernetMenta. I guess he is the only one able to answer your questions.
Reply
#3
I have found that in Leia you should implement GetChannelStreamProperties and set a value for PVR_STREAM_PROPERTY_ISREALTIMESTREAM to "true" to get the expected behavior.  I also return true/false from IsRealTimeStream, but I don't believe it has any effect anymore.  My assumption is that it's a legacy holdover from Krypton, but honestly never investigated it.

snip:

cpp:
PVR_ERROR GetChannelStreamProperties(PVR_CHANNEL const* channel, PVR_NAMED_VALUE* props, unsigned int* numprops)
{
     /* irrelevant code removed */

    // PVR_STREAM_PROPERTY_MIMETYPE
    snprintf(props[0].strName, std::extent<decltype(props[0].strName)>::value, PVR_STREAM_PROPERTY_MIMETYPE);
    snprintf(props[0].strValue, std::extent<decltype(props[0].strName)>::value, "%s", g_pvrstream->mediatype());

    // PVR_STREAM_PROPERTY_ISREALTIMESTREAM
    snprintf(props[1].strName, std::extent<decltype(props[1].strName)>::value, PVR_STREAM_PROPERTY_ISREALTIMESTREAM);
    snprintf(props[1].strValue, std::extent<decltype(props[1].strName)>::value, (g_pvrstream->realtime() ? "true" : "false"));

    *numprops = 2;

    return PVR_ERROR_NO_ERROR;
}

Also of note is that this function will be called before OpenLiveStream(), so if you need to open the stream first to know what to set things you may have to do something like I did -- you know where to find that particular hack job I came up with if you want to see how I worked around it. Good luck Matt!
Reply

Logout Mark Read Team Forum Stats Members Help
IsRealTimeStream callback -- Does not do what I expect.0