Skip to content

Commit

Permalink
Try to fix armv7a
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvana-7777 committed Nov 20, 2023
1 parent a871317 commit 0a73117
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 27 deletions.
3 changes: 1 addition & 2 deletions pvr.eon/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.eon"
version="20.7.5"
version="20.7.6"
name="EON PVR Client"
provider-name="Nirvana">
<requires>
@ADDON_DEPENDS@
<import addon="inputstream.ffmpegdirect" minversion="20.0.0"/>
<import addon="inputstream.adaptive" minversion="20.0.0"/>
<import addon="script.module.inputstreamhelper" version="0.5.8"/>
</requires>
Expand Down
2 changes: 2 additions & 0 deletions pvr.eon/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
45 changes: 23 additions & 22 deletions src/PVREon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down Expand Up @@ -768,14 +764,13 @@ bool CPVREon::HandleSession(bool start, int cid, int epg_id)

void CPVREon::SetStreamProperties(std::vector<kodi::addon::PVRStreamProperty>& 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();

Expand All @@ -791,7 +786,10 @@ void CPVREon::SetStreamProperties(std::vector<kodi::addon::PVRStreamProperty>& 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)
Expand All @@ -817,9 +815,9 @@ void CPVREon::SetStreamProperties(std::vector<kodi::addon::PVRStreamProperty>& 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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1049,7 +1047,7 @@ PVR_ERROR CPVREon::GetChannels(bool bRadio, kodi::addon::PVRChannelsResultSet& r
}

PVR_ERROR CPVREon::GetStreamProperties(
const EonChannel& channel, std::vector<kodi::addon::PVRStreamProperty>& properties, const int& starttime, const int& endtime, const bool& isLive)
const EonChannel& channel, std::vector<kodi::addon::PVRStreamProperty>& properties, time_t starttime,/* time_t endtime,*/ const bool& isLive)
{
kodi::Log(ADDON_LOG_DEBUG, "function call: [%s]", __FUNCTION__);
std::string streaming_profile = "hp7000";
Expand Down Expand Up @@ -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 + ";" +
Expand All @@ -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");
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/PVREon.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ class ATTR_DLL_LOCAL CPVREon : public kodi::addon::CAddonBase,

void SetStreamProperties(std::vector<kodi::addon::PVRStreamProperty>& 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<kodi::addon::PVRStreamProperty>& properties, const int& starttime, const int& endtime, const bool& isLive);
std::vector<kodi::addon::PVRStreamProperty>& properties, time_t starttime,/* time_t endtime, */const bool& isLive);

std::vector<EonChannel> m_channels;
std::vector<EonServer> m_live_servers;
Expand Down

0 comments on commit 0a73117

Please sign in to comment.