Problem with EOF seek on live stream when playing on another device

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
djp952
Posts: 748
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Problem with EOF seek on live stream when playing on another device

Postby djp952 » Fri Aug 03, 2018 8:07 pm

Hi! I'm running into a problem with seeking a live stream from the HDHomeRun RECORD engine if the stream is active on another device. I'm not sure if this is relatively new or just something I haven't encountered to date.

When streaming a channel from the RECORD engine that is already playing on an active device, an attempt to seek beyond the end of the stream is resulting in an HTTP 503: Service Unavailable error. The same operation against a channel not active on another device works as expected and returns an HTTP 206 with the actually satisfied byte range.

I'm not sure how to handle this response properly if it's the expected behavior. I could retry the operation without sending a range header, which should restart back at the "live" position, but then I don't get back the Content-Range: response, which I'm using to determine if it is a live or recorded stream (or has transitioned from live to recorded).

Any advice/assistance on how to handle this properly would be greatly appreciated, or knowing if it's an issue with the RECORD engine that will be corrected at some point in the future that's even better (for me)! :mrgreen:

Here is an example of the HTTP response when seeking to the 'end' of a live stream that is already playing and causing HTTP 503. The "restart -->" is from my code indicating where the Range header will be set to. The failure occurs with any value greater than the length of the currently playing live stream on another device:

Code: Select all

restart --> pos = 0 HTTP/1.1 206 Partial Content Server: HDHomeRun/1.0 Connection: close Content-Type: video/mpeg Content-Range: bytes 0-9223372036854775806/* X-Content-BitsPerSecond: 12663752 Accept-Ranges: bytes Date: Sat, 04 Aug 2018 02:45:54 GMT transferMode.dlna.org: Streaming restart --> pos = 9223372036854775806 HTTP/1.1 503 Service Unavailable Server: HDHomeRun/1.0 Connection: close Content-Length: 0 Accept-Ranges: bytes Date: Sat, 04 Aug 2018 02:45:54 GMT Exception thrown at 0x7478DDC2 in kodi.exe: Microsoft C++ exception: http_exception at memory location 0x11F0EC80.
Here is an example of the HTTP response when seeking to the 'end' of a live stream that is not already playing and gets the expected HTTP 206 given the same Range request(s):

Code: Select all

restart --> pos = 0 HTTP/1.1 206 Partial Content Server: HDHomeRun/1.0 Connection: close Content-Type: video/mpeg Content-Range: bytes 0-9223372036854775806/* X-Content-BitsPerSecond: 13845931 Accept-Ranges: bytes Date: Sat, 04 Aug 2018 02:48:20 GMT transferMode.dlna.org: Streaming restart --> pos = 9223372036854775806 HTTP/1.1 206 Partial Content Server: HDHomeRun/1.0 Connection: close Content-Type: video/mpeg Content-Range: bytes 24271176-9223372036854775806/* X-Content-BitsPerSecond: 13869243 Accept-Ranges: bytes Date: Sat, 04 Aug 2018 02:48:20 GMT transferMode.dlna.org: Streaming
Thank you!!

nickk
Silicondust
Posts: 15280
Joined: Tue Jan 13, 2004 9:39 am

Re: Problem with EOF seek on live stream when playing on another device

Postby nickk » Fri Aug 03, 2018 8:53 pm

That number is causing a signed 64-bit overflow internally when the zero reference is applied resulting in an error.

Will investigate further.

nickk
Silicondust
Posts: 15280
Joined: Tue Jan 13, 2004 9:39 am

Re: Problem with EOF seek on live stream when playing on another device

Postby nickk » Fri Aug 03, 2018 11:48 pm

Problem found and fixed. In will be in the next beta release in a few days.

Nick

djp952
Posts: 748
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Problem with EOF seek on live stream when playing on another device

Postby djp952 » Sat Aug 04, 2018 12:21 pm

Problem found and fixed. In will be in the next beta release in a few days.

Nick
Thank you sir!


Return to “Development Support”

Who is online

Users browsing this forum: No registered users and 1 guest