Skip to content

Commit

Permalink
Merge pull request #162 from emveepee/androidcheck
Browse files Browse the repository at this point in the history
Timeshift fixes
  • Loading branch information
phunkyfish authored Feb 3, 2021
2 parents 0199454 + 47464a0 commit 2e58d29
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pvr.nextpvr/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.nextpvr"
version="8.2.0"
version="8.2.1"
name="NextPVR PVR Client"
provider-name="Graeme Blackley">
<requires>@ADDON_DEPENDS@
Expand Down
5 changes: 5 additions & 0 deletions pvr.nextpvr/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v8.2.1
- Fixed a missing count on another duration call
- force radix 10 on strtoll
- Add 64 bit cast to time_t for

v8.2.0
- Flag timers with invalid channel life
- Automatically renew sid lifetime on playback close
Expand Down
3 changes: 2 additions & 1 deletion src/BackendRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ namespace NextPVR
RenewSID();
}
}
kodi::Log(ADDON_LOG_DEBUG, "DoRequest return %s %d %d %d", resource.c_str(), resultCode, response.length(), std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - start));
int milliseconds = static_cast<int>(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - start).count());
kodi::Log(ADDON_LOG_DEBUG, "DoRequest return %s %d %d %d", resource.c_str(), resultCode, response.length(), milliseconds);
return resultCode;
}

Expand Down
4 changes: 2 additions & 2 deletions src/buffers/ClientTimeshift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ bool ClientTimeShift::GetStreamInfo()
tinyxml2::XMLNode* filesNode = doc.FirstChildElement("map");
if (filesNode != nullptr)
{
stream_duration = strtoll(filesNode->FirstChildElement("stream_duration")->GetText(), nullptr, 0);
stream_duration = strtoll(filesNode->FirstChildElement("stream_duration")->GetText(), nullptr, 10);
if (stream_duration != 0)
{
m_stream_length = strtoll(filesNode->FirstChildElement("stream_length")->GetText(), nullptr, 0);
m_stream_length = strtoll(filesNode->FirstChildElement("stream_length")->GetText(), nullptr, 10);
m_stream_duration = stream_duration / 1000;
if (m_stream_duration > m_settings.m_timeshiftBufferSeconds)
{
Expand Down
8 changes: 4 additions & 4 deletions src/buffers/RollingFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ bool RollingFile::GetStreamInfo()
tinyxml2::XMLNode* filesNode = doc.FirstChildElement("Files");
if (filesNode != nullptr)
{
stream_length = strtoll(filesNode->FirstChildElement("Length")->GetText(), nullptr, 0);
duration = strtoll(filesNode->FirstChildElement("Duration")->GetText(), nullptr, 0);
stream_length = strtoll(filesNode->FirstChildElement("Length")->GetText(), nullptr, 10);
duration = strtoll(filesNode->FirstChildElement("Duration")->GetText(), nullptr, 10);
XMLUtils::GetBoolean(filesNode, "Complete", m_complete);
kodi::Log(ADDON_LOG_DEBUG, "channel.stream.info %lld %lld %d %d", stream_length, duration, m_complete, m_bytesPerSecond.load());
if (m_complete == true)
Expand Down Expand Up @@ -281,8 +281,8 @@ PVR_ERROR RollingFile::GetStreamTimes(kodi::addon::PVRStreamTimes& stimes)
return RecordingBuffer::GetStreamTimes(stimes);
stimes.SetStartTime(m_streamStart);
stimes.SetPTSStart(0);
stimes.SetPTSBegin((m_rollingStartSeconds - m_streamStart) * STREAM_TIME_BASE);
stimes.SetPTSEnd((time(nullptr) - m_streamStart) * STREAM_TIME_BASE);
stimes.SetPTSBegin(static_cast<int64_t>(m_rollingStartSeconds - m_streamStart) * STREAM_TIME_BASE);
stimes.SetPTSEnd(static_cast<int64_t>(time(nullptr) - m_streamStart) * STREAM_TIME_BASE);
return PVR_ERROR_NO_ERROR;
}

Expand Down

0 comments on commit 2e58d29

Please sign in to comment.