diff --git a/pvr.eon/addon.xml.in b/pvr.eon/addon.xml.in index 8f2c6e6..ca4281b 100644 --- a/pvr.eon/addon.xml.in +++ b/pvr.eon/addon.xml.in @@ -1,12 +1,11 @@ @ADDON_DEPENDS@ - diff --git a/pvr.eon/changelog.txt b/pvr.eon/changelog.txt index 6e5f2e2..cc15c35 100644 --- a/pvr.eon/changelog.txt +++ b/pvr.eon/changelog.txt @@ -20,3 +20,5 @@ v20.7.4 - Exploit some more EPG data (live, age, seasons, episodes) v20.7.5 - Fix startup with empty credentials and web +v20.7.6 + - Try to fix armv7a diff --git a/src/PVREon.cpp b/src/PVREon.cpp index d26a760..81a9897 100644 --- a/src/PVREon.cpp +++ b/src/PVREon.cpp @@ -144,13 +144,9 @@ bool CPVREon::GetPostJson(const std::string& url, const std::string& body, rapid doc.Parse(result.c_str()); if ((doc.GetParseError()) || (statusCode != 200 && statusCode != 206)) { - kodi::Log(ADDON_LOG_ERROR, "Failed to get JSON %s status code: %i", url.c_str(), statusCode); - if (!body.empty()) { - kodi::Log(ADDON_LOG_ERROR, "Body was %s", body.c_str()); - } - if (result.empty()) { - kodi::Log(ADDON_LOG_ERROR, "Empty result returned"); - } else { + kodi::Log(ADDON_LOG_ERROR, "Failed to get JSON for URL %s and body %s. Status code: %i", url.c_str(), body.c_str(), statusCode); + if (!doc.GetParseError()) + { kodi::Log(ADDON_LOG_ERROR, "Result is: %s", result.c_str()); if (doc.HasMember("error") && doc.HasMember("errorMessage")) { @@ -768,14 +764,13 @@ bool CPVREon::HandleSession(bool start, int cid, int epg_id) void CPVREon::SetStreamProperties(std::vector& properties, const std::string& url, - const bool& realtime, const bool& playTimeshiftBuffer, const bool& isLive, - const int& starttime, const int& endtime) + const bool& realtime, const bool& playTimeshiftBuffer, const bool& isLive/*, + time_t starttime, time_t endtime*/) { kodi::Log(ADDON_LOG_DEBUG, "[PLAY STREAM] url: %s", url.c_str()); properties.emplace_back(PVR_STREAM_PROPERTY_STREAMURL, url); properties.emplace_back(PVR_STREAM_PROPERTY_ISREALTIMESTREAM, realtime ? "true" : "false"); - properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/x-mpegURL"); int inputstream = m_settings->GetInputstream(); @@ -791,7 +786,10 @@ void CPVREon::SetStreamProperties(std::vector& p properties.emplace_back("inputstream.adaptive.manifest_type", "hls"); // properties.emplace_back("inputstream.adaptive.original_audio_language", "bs"); // properties.emplace_back("inputstream.adaptive.stream_selection_type", "adaptive"); - properties.emplace_back("inputstream.adaptive.stream_selection_type", "manual-osd"); + // properties.emplace_back("inputstream.adaptive.stream_selection_type", "manual-osd"); + properties.emplace_back("inputstream.adaptive.stream_selection_type", "fixed-res"); + properties.emplace_back("inputstream.adaptive.chooser_resolution_max", "4K"); + //properties.emplace_back("inputstream.adaptive.stream_selection_type", "fixed-res"); properties.emplace_back("inputstream.adaptive.manifest_headers", "User-Agent=" + EonParameters[m_params].user_agent); // properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full"); } else if (inputstream == INPUTSTREAM_FFMPEGDIRECT) @@ -817,9 +815,9 @@ void CPVREon::SetStreamProperties(std::vector& p } else { kodi::Log(ADDON_LOG_DEBUG, "Unknown inputstream detected"); } + properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, "application/x-mpegURL"); } - PVR_ERROR CPVREon::GetCapabilities(kodi::addon::PVRCapabilities& capabilities) { capabilities.SetSupportsEPG(true); @@ -913,10 +911,10 @@ PVR_ERROR CPVREon::GetEPGForChannel(int channelUid, tag.SetUniqueChannelId(channelUid); tag.SetTitle(Utils::JsonStringOrEmpty(epgItem,"title")); tag.SetOriginalTitle(Utils::JsonStringOrEmpty(epgItem,"originalTitle")); - int64_t starttime = Utils::JsonInt64OrZero(epgItem,"startTime") / 1000; - int64_t endtime = Utils::JsonInt64OrZero(epgItem,"endTime") / 1000; - tag.SetStartTime((int)starttime); - tag.SetEndTime((int)endtime); + time_t starttime = (time_t) (Utils::JsonInt64OrZero(epgItem,"startTime") / 1000); + time_t endtime = (time_t) (Utils::JsonInt64OrZero(epgItem,"endTime") / 1000); + tag.SetStartTime(starttime); + tag.SetEndTime(endtime); tag.SetPlot(Utils::JsonStringOrEmpty(epgItem,"shortDescription")); int seasonNumber = Utils::JsonIntOrZero(epgItem,"seasonNumber"); if (seasonNumber != 0) @@ -993,7 +991,7 @@ PVR_ERROR CPVREon::GetEPGTagStreamProperties( { if (channel.iUniqueId == tag.GetUniqueChannelId()) { - return GetStreamProperties(channel, properties, tag.GetStartTime(), tag.GetEndTime(), false); + return GetStreamProperties(channel, properties, tag.GetStartTime(), /*tag.GetEndTime(),*/ false); } } return PVR_ERROR_NO_ERROR; @@ -1049,7 +1047,7 @@ PVR_ERROR CPVREon::GetChannels(bool bRadio, kodi::addon::PVRChannelsResultSet& r } PVR_ERROR CPVREon::GetStreamProperties( - const EonChannel& channel, std::vector& properties, const int& starttime, const int& endtime, const bool& isLive) + const EonChannel& channel, std::vector& properties, time_t starttime,/* time_t endtime,*/ const bool& isLive) { kodi::Log(ADDON_LOG_DEBUG, "function call: [%s]", __FUNCTION__); std::string streaming_profile = "hp7000"; @@ -1098,7 +1096,7 @@ PVR_ERROR CPVREon::GetStreamProperties( "session=" + m_session_id + ";" + "maxvbr=" + std::to_string(rndbitrate); if (!isLive) { - plain_aes = plain_aes + ";t=" + std::to_string(starttime) + "000;"; + plain_aes = plain_aes + ";t=" + std::to_string((int) starttime) + "000;"; } } else { plain_aes = "channel=" + channel.publishingPoints[0].publishingPoint + ";" + @@ -1113,7 +1111,7 @@ PVR_ERROR CPVREon::GetStreamProperties( "ctime=" + GetTime() + ";" + "conn=" + CONN_TYPE_BROWSER + ";"; if (!isLive) { - plain_aes = plain_aes + "t=" + std::to_string(starttime) + "000;"; + plain_aes = plain_aes + "t=" + std::to_string((int) starttime) + "000;"; } plain_aes = plain_aes + "aa=" + (channel.aaEnabled ? "true" : "false"); } @@ -1151,7 +1149,10 @@ PVR_ERROR CPVREon::GetStreamProperties( kodi::Log(ADDON_LOG_DEBUG, "Encrypted Stream URL -> %s", enc_url.c_str()); - SetStreamProperties(properties, enc_url, true, false, isLive, starttime, endtime); + SetStreamProperties(properties, enc_url, true, false, isLive/*, starttime, endtime*/); + + for (auto& prop : properties) + kodi::Log(ADDON_LOG_DEBUG, "Name: %s Value: %s", prop.GetName().c_str(), prop.GetValue().c_str()); return PVR_ERROR_NO_ERROR; } @@ -1163,7 +1164,7 @@ PVR_ERROR CPVREon::GetChannelStreamProperties( EonChannel addonChannel; if (GetChannel(channel, addonChannel)) { if (addonChannel.subscribed) { - return GetStreamProperties(addonChannel, properties, 0, 0, true); + return GetStreamProperties(addonChannel, properties, 0,/* 0,*/ true); } kodi::Log(ADDON_LOG_DEBUG, "Channel not subscribed"); return PVR_ERROR_SERVER_ERROR; diff --git a/src/PVREon.h b/src/PVREon.h index a9ab60f..046a40f 100644 --- a/src/PVREon.h +++ b/src/PVREon.h @@ -210,12 +210,12 @@ class ATTR_DLL_LOCAL CPVREon : public kodi::addon::CAddonBase, void SetStreamProperties(std::vector& properties, const std::string& url, - const bool& realtime, const bool& playTimeshiftBuffer, const bool& isLive, - const int& starttime, const int& endtime); + const bool& realtime, const bool& playTimeshiftBuffer, const bool& isLive /*, + time_t starttime, time_t endtime*/); PVR_ERROR GetStreamProperties( const EonChannel& channel, - std::vector& properties, const int& starttime, const int& endtime, const bool& isLive); + std::vector& properties, time_t starttime,/* time_t endtime, */const bool& isLive); std::vector m_channels; std::vector m_live_servers;