Skip to content

Fix stream type detection for servers rejecting HEAD and avoid repeated inspection - #1050

Open
danog wants to merge 2 commits into
kodi-pvr:Piersfrom
danog:stream-type-detection
Open

danog wants to merge 2 commits into
kodi-pvr:Piersfrom
danog:stream-type-detection

Conversation

@danog

@danog danog commented Oct 22, 2026

Copy link
Copy Markdown

Fixes two problems in the stream type detection:

  • Rai 3 doesn't play. Its DASH manifest (Rai Way CDN) answers HEAD with 403 and GET with 200. InspectStreamType() first checks FileExists(), which uses HEAD, so the type stays unknown and the stream is handed to the ffmpeg demuxer ("error probing input format") instead of inputstream.adaptive. HTTP URLs now skip the HEAD; the GET that sniffs the content already detects unreachable streams.
  • Extra request on every channel switch. For URLs without a recognisable extension (e.g. the Rai relinker) SetAllStreamProperties() inspected the URL again although the catchup controller had just looked up, and cached, its type for the same URL. That type is now reused, saving a request (1-2 s) per switch.

Tested on Kodi master on macOS: Rai 3 plays through inputstream.adaptive; repeat switches to relinker channels no longer request the URL before playback.

danog added 2 commits October 22, 2026 23:08
Some servers answer HEAD with 403 while serving GET normally (e.g. the
Rai 3 DASH manifest on cdn.netrw.it). The HEAD-based FileExists() check
then fails, the stream type stays unknown and the URL is handed to the
FFmpeg demuxer instead of inputstream.adaptive, so playback fails.

For HTTP URLs, rely on the GET used to sniff the content instead.
GetChannelStreamProperties() looks up the stream type through the
catchup controller, which caches it, and then SetAllStreamProperties()
inspected the same URL again. For URLs without a recognisable extension
(redirectors, token services) this meant an extra HTTP request on every
channel switch, adding 1-2 s before playback could start.

Pass the type the catchup controller found for the same URL and only
inspect when it is unknown.
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.

1 participant