Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync with Kodi PR 6566 #1

Merged
merged 5 commits into from
Mar 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pvr.hts/addon.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.hts"
version="2.1.1"
version="2.1.2"
name="Tvheadend HTSP Client"
provider-name="Adam Sutton, Sam Stenvall, Lars Op den Kamp">
<requires>
<c-pluff version="0.1"/>
<import addon="xbmc.pvr" version="1.9.4"/>
<import addon="xbmc.pvr" version="1.9.5"/>
<import addon="xbmc.codec" version="1.0.1"/>
<import addon="xbmc.gui" version="5.8.0"/>
</requires>
Expand All @@ -16,7 +16,10 @@
library_osx="pvr.hts.dylib"
library_freebsd="pvr.hts.so"
library_windx="pvr.hts.dll"
library_android="libpvr.hts.so"/>
library_android="libpvr.hts.so"
avahi_type="_htsp._tcp."
avahi_ip_setting="host"
avahi_port_setting="htsp_port"/>
<extension point="xbmc.addon.metadata">
<summary lang="af">Kodi se voorprogram vir Tvheadend</summary>
<summary lang="be">Kodi's frontend for Tvheadend</summary>
Expand Down
3 changes: 3 additions & 0 deletions pvr.hts/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.1.2
- Updated to PVR API v1.9.5

2.1.1
- Updated to PVR API v1.9.4
- Updated to GUI API v5.8.0
Expand Down
12 changes: 9 additions & 3 deletions src/HTSPVFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ void *CHTSPVFS::Process(void)
*/
CHTSPVFS::CHTSPVFS ( CHTSPConnection &conn )
: m_conn(conn), m_path(""), m_fileId(0), m_offset(0),
m_currentReadLength(INITAL_READ_LENGTH)
m_currentReadLength(INITAL_READ_LENGTH),
m_bHasData(false),
m_bSeekDone(true)
{
m_buffer.alloc(MAX_BUFFER_SIZE);

Expand Down Expand Up @@ -136,29 +138,32 @@ void CHTSPVFS::Reset()
CLockObject lock(m_mutex);
m_buffer.reset();
m_bHasData = false;
m_bSeekDone = true;
m_currentReadLength = INITAL_READ_LENGTH;
m_seekCondition.Signal();
}

int CHTSPVFS::Read ( unsigned char *buf, unsigned int len )
{
ssize_t ret;
CLockObject lock(m_mutex);

/* Not opened */
if (!m_fileId)
return -1;

m_seekCondition.Wait(m_mutex, m_bSeekDone, 5000);

/* Signal that we need more data in the buffer. Reset the read length to the
requested length so we don't wait unnecessarily long */
if (m_buffer.avail() < len)
{
CLockObject lock(m_mutex);
m_bHasData = false;
m_currentReadLength = len;
m_condition.Broadcast();
}

/* Wait for data */
CLockObject lock(m_mutex);
m_condition.Wait(m_mutex, m_bHasData, 5000);

/* Read */
Expand All @@ -172,6 +177,7 @@ long long CHTSPVFS::Seek ( long long pos, int whence )
CLockObject lock(m_conn.Mutex());
if (m_fileId == 0)
return -1;
m_bSeekDone = false;
return SendFileSeek(pos, whence);
}

Expand Down
12 changes: 5 additions & 7 deletions src/Tvheadend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*
*/

#include <sstream>
#include <algorithm>
#include "Tvheadend.h"

Expand Down Expand Up @@ -49,7 +48,8 @@ CTvheadend::CTvheadend(tvheadend::Settings settings)

CTvheadend::~CTvheadend()
{
m_conn.StopThread();
m_conn.StopThread(-1);
m_conn.Disconnect();
StopThread();
}

Expand Down Expand Up @@ -377,6 +377,9 @@ PVR_ERROR CTvheadend::GetRecordings ( ADDON_HANDLE handle )
}
}

/* EPG event id */
rec.iEpgEventId = rit->second.eventId;

recs.push_back(rec);
}
}
Expand Down Expand Up @@ -687,11 +690,6 @@ void CTvheadend::TransferEvent
epg.iEpisodeNumber = event.episode;
epg.iEpisodePartNumber = event.part;

std::stringstream ss;
ss << event.recordingId;
const std::string recordingId = ss.str();
epg.strRecordingId = recordingId.c_str();

/* Callback. */
PVR->TransferEpgEntry(handle, &epg);
}
Expand Down
2 changes: 2 additions & 0 deletions src/Tvheadend.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ class CHTSPVFS
CCircBuffer m_buffer;
PLATFORM::CMutex m_mutex;
bool m_bHasData;
bool m_bSeekDone;
PLATFORM::CCondition<bool> m_condition;
PLATFORM::CCondition<bool> m_seekCondition;
size_t m_currentReadLength;

bool Open ( const PVR_RECORDING &rec );
Expand Down