Skip to content

Commit 7098b97

Browse files
authored
Merge pull request #64 from ksooo/fix-hls-quirks
Add setting to work around broken HLS streams provided by pluto.tv …
2 parents f11bcc2 + b737906 commit 7098b97

File tree

6 files changed

+29
-16
lines changed

6 files changed

+29
-16
lines changed

pvr.plutotv/addon.xml.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<addon
33
id="pvr.plutotv"
4-
version="21.1.1"
4+
version="21.2.0"
55
name="Pluto.tv PVR Client"
66
provider-name="Team Kodi, flubshi">
77
<requires>@ADDON_DEPENDS@

pvr.plutotv/changelog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v21.2.0
2+
- Add setting to work around broken HLS streams provided by pluto.tv (requires inputstream.adaptive > 21.4.5)
3+
14
v21.1.1
25
- Translations updates from Weblate
36
- af_za, am_et, ar_sa, ast_es, az_az, be_by, bg_bg, bs_ba, ca_es, cs_cz, cy_gb, da_dk, de_de, el_gr, en_au, en_nz, en_us, eo, es_ar, es_es, es_mx, et_ee, eu_es, fa_af, fa_ir, fi_fi, fo_fo, fr_ca, fr_fr, gl_es, he_il, hi_in, hr_hr, hu_hu, hy_am, id_id, is_is, it_it, ja_jp, ko_kr, lt_lt, lv_lv, mi, mk_mk, ml_in, mn_mn, ms_my, mt_mt, my_mm, nb_no, nl_nl, pl_pl, pt_br, pt_pt, ro_ro, ru_ru, si_lk, sk_sk, sl_si, sq_al, sr_rs, sr_rs@latin, sv_se, szl, ta_in, te_in, tg_tj, th_th, tr_tr, uk_ua, uz_uz, vi_vn, zh_cn, zh_tw

pvr.plutotv/resources/language/resource.language.en_gb/strings.po

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ msgctxt "#30008"
3434
msgid "First channel number"
3535
msgstr ""
3636

37+
msgctxt "#30009"
38+
msgid "Workaround for broken streams (requires inputstream.adaptive > 21.4.5)"
39+
msgstr ""
40+
3741
msgctxt "#30040"
3842
msgid "Debug"
3943
msgstr ""

pvr.plutotv/resources/settings.xml

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" ?>
22
<settings version="1">
33
<section id="pvr.plutotv">
4-
<category id="credentials" label="30001" help="">
4+
<category id="general" label="30001" help="">
55
<group id="1" label="">
66
<setting id="start_channelnum" type="integer" label="30008" help="">
77
<level>0</level>
@@ -11,8 +11,12 @@
1111
</constraints>
1212
<control type="edit" format="integer" />
1313
</setting>
14-
<setting id="install_widevine" type="string" label="30007"
15-
help="">
14+
<setting id="workaround_broken_streams" type="boolean" label="30009" help="-1">
15+
<level>2</level>
16+
<default>true</default>
17+
<control type="toggle"/>
18+
</setting>
19+
<setting id="install_widevine" type="string" label="30007" help="">
1620
<level>0</level>
1721
<default />
1822
<constraints>
@@ -25,8 +29,7 @@
2529
<dependency type="visible" operator="!is"
2630
setting="system.platform.android">true</dependency>
2731
</setting>
28-
<setting id="run_is_info" type="string" label="30006"
29-
help="">
32+
<setting id="run_is_info" type="string" label="30006" help="">
3033
<level>0</level>
3134
<default />
3235
<constraints>
@@ -35,24 +38,21 @@
3538
<control type="button" format="action">
3639
<data>RunScript(script.module.inputstreamhelper,info)</data>
3740
</control>
38-
<dependency type="visible" operator="!is"
39-
setting="system.platform.android">true</dependency>
41+
<dependency type="visible" operator="!is" setting="system.platform.android">true</dependency>
4042
</setting>
4143
</group>
4244
</category>
4345
<category id="debug" label="30040" help="">
4446
<group id="1" label="">
45-
<setting id="internal_sid" type="string" label="30041"
46-
help="">
47+
<setting id="internal_sid" type="string" label="30041" help="">
4748
<level>3</level>
4849
<default />
4950
<constraints>
5051
<allowempty>true</allowempty>
5152
</constraints>
5253
<control type="edit" format="string"></control>
5354
</setting>
54-
<setting id="internal_deviceid" type="string" label="30042"
55-
help="">
55+
<setting id="internal_deviceid" type="string" label="30042" help="">
5656
<level>3</level>
5757
<default />
5858
<constraints>
@@ -63,4 +63,4 @@
6363
</group>
6464
</category>
6565
</section>
66-
</settings>
66+
</settings>

src/PlutotvData.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ void PlutotvData::SetStreamProperties(std::vector<kodi::addon::PVRStreamProperty
7676
properties.emplace_back(PVR_STREAM_PROPERTY_INPUTSTREAM, "inputstream.adaptive");
7777
properties.emplace_back(PVR_STREAM_PROPERTY_ISREALTIMESTREAM, realtime ? "true" : "false");
7878
// HLS
79-
kodi::Log(ADDON_LOG_DEBUG, "[PLAY STREAM] hls");
80-
properties.emplace_back("inputstream.adaptive.manifest_type", "hls");
8179
properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/x-mpegURL");
82-
properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full");
80+
if (GetSettingsWorkaroundBrokenStreams())
81+
properties.emplace_back("inputstream.adaptive.manifest_config",
82+
"{\"hls_ignore_endlist\":true,\"hls_fix_mediasequence\":true,\"hls_fix_discsequence\":true}");
8383
}
8484

8585
bool PlutotvData::LoadChannelsData()
@@ -268,6 +268,11 @@ int PlutotvData::GetSettingsStartChannel() const
268268
return kodi::addon::GetSettingInt("start_channelnum", 1);
269269
}
270270

271+
bool PlutotvData::GetSettingsWorkaroundBrokenStreams() const
272+
{
273+
return kodi::addon::GetSettingBoolean("workaround_broken_streams", true);
274+
}
275+
271276
std::string PlutotvData::GetChannelStreamURL(int uniqueId)
272277
{
273278
LoadChannelsData();

src/PlutotvData.h

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class ATTR_DLL_LOCAL PlutotvData : public kodi::addon::CAddonBase,
7575
std::string GetChannelStreamURL(int uniqueId);
7676
std::string GetSettingsUUID(const std::string& setting);
7777
int GetSettingsStartChannel() const;
78+
bool GetSettingsWorkaroundBrokenStreams() const;
7879
void SetStreamProperties(std::vector<kodi::addon::PVRStreamProperty>& properties,
7980
const std::string& url,
8081
bool realtime);

0 commit comments

Comments
 (0)