Skip to content

Commit

Permalink
IPTV HLS Restore GuessProtocol old behavior
Browse files Browse the repository at this point in the history
Restore the old behavior of the GuessProtocol function.
This means that http/https URL's that cannot be downloaded
are identified as http_ts type of files.
This fixes the unit test TestIPTVRecorder.
The underlying problem in iptvtuningdata.h is that
the enum IPTVProtocol does mix values representing
a protocol, e.g. udp and rtp, with values representing
the content of what is downloaded.
In this case http and https are protocols and should
be part of the enumeration.
In contrast, http_ts specifies a TS stream in a https stream
and http_hls specifies a HLS playlist in a http or https stream.
The protocol specifications are considered to be valid
when they are syntactically correct, even when they do not exist.
The content can only be verified if the URL resource can
be downloaded.
There should be separate enumerations for protocol and
for resource content. This is likely to be non-trivial
and hence the old behavior is restored for now.

Refs #936
  • Loading branch information
kmdewaal committed Jan 26, 2025
1 parent 8e7b387 commit bc586d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/iptvtuningdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class MTV_PUBLIC IPTVTuningData
return (m_protocol == http_ts);
}

// An http(s) URL is invalid if it cannot be downloaded
// An HLSPlaylist URL is identified as http_ts if download fails.
void GuessProtocol(void)
{
if (!m_dataUrl.isValid())
Expand All @@ -227,7 +227,7 @@ class MTV_PUBLIC IPTVTuningData
m_protocol = IPTVTuningData::http_ts;
}
else
m_protocol = IPTVTuningData::inValid;
m_protocol = IPTVTuningData::http_ts; // Breaks the unit test if set to inValid
}
else
m_protocol = IPTVTuningData::inValid;
Expand Down

0 comments on commit bc586d8

Please sign in to comment.