Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
[MediaPortal] Better error logging on failures
Browse files Browse the repository at this point in the history
PVR addon version number increase + update changelog
  • Loading branch information
margro committed Dec 9, 2013
1 parent 9d2f483 commit 2c420ed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
4 changes: 3 additions & 1 deletion addons/pvr.mediaportal.tvserver/addon/changelog.txt
@@ -1,6 +1,8 @@
v1.6.10
- TSReader: Fixed: channel switching behavior when switching across tsbuffer files
- Recordings: Add support for retrieving and storing the playback resume position (requires TVServerXBMC build 121 or higher)
- Fixed: Hide smb password in debug xbmc.log file
- Changed: more log notifications on errors
- EPG: added additional genre strings to the genre string to id translation table

v1.6.9
Expand Down Expand Up @@ -139,4 +141,4 @@ v1.1.0.75
- PVR client should abort connection when the TVServerXBMC version is too old

v1.1.0.60
- Fix PVR client destroy
- Fix PVR client destroy
36 changes: 20 additions & 16 deletions addons/pvr.mediaportal.tvserver/src/pvrclient-mediaportal.cpp
Expand Up @@ -42,13 +42,13 @@ using namespace ADDON;
int g_iTVServerXBMCBuild = 0;

/* PVR client version (don't forget to update also the addon.xml and the Changelog.txt files) */
#define PVRCLIENT_MEDIAPORTAL_VERSION_STRING "1.6.9"
#define PVRCLIENT_MEDIAPORTAL_VERSION_STRING "1.6.10"

/* TVServerXBMC plugin supported versions */
#define TVSERVERXBMC_MIN_VERSION_STRING "1.1.0.90"
#define TVSERVERXBMC_MIN_VERSION_BUILD 90
#define TVSERVERXBMC_RECOMMENDED_VERSION_STRING "1.2.3.122 or 1.3.0.122"
#define TVSERVERXBMC_RECOMMENDED_VERSION_BUILD 122
#define TVSERVERXBMC_RECOMMENDED_VERSION_STRING "1.2.3.122, 1.3.0.124, 1.4.0.124 or 1.5.0.124"
#define TVSERVERXBMC_RECOMMENDED_VERSION_BUILD 124

/************************************************************/
/** Class interface */
Expand Down Expand Up @@ -1360,7 +1360,7 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)

if (result.find("ERROR") != std::string::npos || result.length() == 0)
{
XBMC->Log(LOG_ERROR, "Could not start the timeshift for channel uid=%i. %s", channelinfo.iUniqueId, result.c_str());
XBMC->Log(LOG_ERROR, "Could not start the timeshift for channel uid=%i. Reason: %s", channelinfo.iUniqueId, result.c_str());
if (g_iTVServerXBMCBuild>=109)
{
Tokenize(result, timeshiftfields, "|");
Expand Down Expand Up @@ -1434,11 +1434,11 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)
//[5] = tsbuffer file nr (TVServerXBMC build >= 110)

m_PlaybackURL = timeshiftfields[0];
XBMC->Log(LOG_INFO, "Channel stream URL: %s, timeshift buffer: %s", m_PlaybackURL.c_str(), timeshiftfields[2].c_str());
XBMC->Log(LOG_NOTICE, "Channel stream URL: %s, timeshift buffer: %s", m_PlaybackURL.c_str(), timeshiftfields[2].c_str());

if (g_iSleepOnRTSPurl > 0)
{
XBMC->Log(LOG_DEBUG, "Sleeping %i ms before opening stream: %s", g_iSleepOnRTSPurl, timeshiftfields[0].c_str());
XBMC->Log(LOG_NOTICE, "Sleeping %i ms before opening stream: %s", g_iSleepOnRTSPurl, timeshiftfields[0].c_str());
usleep(g_iSleepOnRTSPurl * 1000);
}

Expand All @@ -1458,7 +1458,7 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)
bool bReturn = false;

// Continue with the existing TsReader.
XBMC->Log(LOG_INFO, "Re-using existing TsReader...");
XBMC->Log(LOG_NOTICE, "Re-using existing TsReader...");
//if(g_bDirectTSFileRead)
if(g_bUseRTSP == false)
{
Expand All @@ -1472,6 +1472,7 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)
else
{
// RTSP url
XBMC->Log(LOG_NOTICE, "Skipping OnZap for TSReader RTSP");
bReturn = true; //Fast forward seek (OnZap) does not work for RTSP
}

Expand All @@ -1482,6 +1483,7 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)
}
else
{
XBMC->Log(LOG_ERROR, "Re-using the existing TsReader failed.");
m_iCurrentChannel = -1;
m_iCurrentCard = -1;
}
Expand All @@ -1490,7 +1492,7 @@ bool cPVRClientMediaPortal::OpenLiveStream(const PVR_CHANNEL &channelinfo)
}
else
{
XBMC->Log(LOG_INFO, "Creating a new TsReader...");
XBMC->Log(LOG_NOTICE, "Creating a new TsReader...");
m_tsreader = new CTsReader();
}

Expand Down Expand Up @@ -1558,7 +1560,7 @@ int cPVRClientMediaPortal::ReadLiveStream(unsigned char *pBuffer, unsigned int i
{
if (read_timeouts > 50)
{
XBMC->Log(LOG_INFO, "No data in 2 seconds");
XBMC->Log(LOG_NOTICE, "No data in 2 seconds");
read_timeouts = 0;
return read_done;
}
Expand Down Expand Up @@ -1587,7 +1589,7 @@ void cPVRClientMediaPortal::CloseLiveStream(void)
SAFE_DELETE(m_tsreader);
}
result = SendCommand("StopTimeshift:\n");
XBMC->Log(LOG_INFO, "CloseLiveStream: %s", result.c_str());
XBMC->Log(LOG_NOTICE, "CloseLiveStream: %s", result.c_str());
m_bTimeShiftStarted = false;
m_iCurrentChannel = -1;
m_iCurrentCard = 0;
Expand Down Expand Up @@ -1637,7 +1639,7 @@ bool cPVRClientMediaPortal::SwitchChannel(const PVR_CHANNEL &channel)

if (g_eStreamingMethod == TSReader)
{
XBMC->Log(LOG_DEBUG, "SwitchChannel(uid=%i) tsreader: open a new live stream", channel.iUniqueId);
XBMC->Log(LOG_NOTICE, "SwitchChannel(uid=%i) tsreader: open a new live stream", channel.iUniqueId);

if (!g_bFastChannelSwitch)
{
Expand Down Expand Up @@ -1713,7 +1715,7 @@ PVR_ERROR cPVRClientMediaPortal::SignalStatus(PVR_SIGNAL_STATUS &signalStatus)
// These URLs are stored in the field PVR_RECORDINGINFO_OLD.stream_url
bool cPVRClientMediaPortal::OpenRecordedStream(const PVR_RECORDING &recording)
{
XBMC->Log(LOG_DEBUG, "->OpenRecordedStream(index=%s)", recording.strRecordingId);
XBMC->Log(LOG_NOTICE, "OpenRecordedStream (id=%s)", recording.strRecordingId);
if (!IsUp())
return false;

Expand Down Expand Up @@ -1741,7 +1743,7 @@ bool cPVRClientMediaPortal::OpenRecordedStream(const PVR_RECORDING &recording)
cRecording myrecording;
if (myrecording.ParseLine(result))
{
XBMC->Log(LOG_DEBUG, "RECORDING: %s", result.c_str() );
XBMC->Log(LOG_NOTICE, "RECORDING: %s", result.c_str() );

if (!g_bUseRTSP)
{
Expand Down Expand Up @@ -1785,7 +1787,7 @@ void cPVRClientMediaPortal::CloseRecordedStream(void)

if (m_tsreader)
{
XBMC->Log(LOG_DEBUG, "CloseRecordedStream: Stop TSReader...");
XBMC->Log(LOG_NOTICE, "CloseRecordedStream: Stop TSReader...");
m_tsreader->Close();
SAFE_DELETE(m_tsreader);
}
Expand Down Expand Up @@ -1865,14 +1867,14 @@ long long cPVRClientMediaPortal::LengthRecordedStream(void)
*/
const char* cPVRClientMediaPortal::GetLiveStreamURL(const PVR_CHANNEL &channelinfo)
{
XBMC->Log(LOG_DEBUG, "->GetLiveStreamURL(uid=%i)", channelinfo.iUniqueId);

if (!OpenLiveStream(channelinfo))
{
XBMC->Log(LOG_ERROR, "GetLiveStreamURL for uid=%i returned no URL", channelinfo.iUniqueId);
return "";
}
else
{
XBMC->Log(LOG_NOTICE, "GetLiveStreamURL for uid=%i is '%s'", channelinfo.iUniqueId, m_PlaybackURL.c_str());
return m_PlaybackURL.c_str();
}
}
Expand Down Expand Up @@ -1913,6 +1915,8 @@ void cPVRClientMediaPortal::LoadGenreTable()

void cPVRClientMediaPortal::LoadCardSettings()
{
XBMC->Log(LOG_DEBUG, "Loading card settings");

/* Retrieve card settings (needed for Live TV and recordings folders) */
if ( g_iTVServerXBMCBuild >= 106 )
{
Expand Down

0 comments on commit 2c420ed

Please sign in to comment.