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

Commit

Permalink
Merge branch 'pr384'. closes #384
Browse files Browse the repository at this point in the history
  • Loading branch information
opdenkamp committed Jan 12, 2015
2 parents 069a9cb + 53c48b2 commit a223ae3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
4 changes: 4 additions & 0 deletions addons/pvr.nextpvr/addon/changelog.txt
@@ -1,5 +1,9 @@
v1.9.19
- added getBackendHostname function
- added support for ATSC subchannel numbers, fixing 'no tuner available' message users were getting with this type of channel
- fixes a problem with playback of radio stations
- added recording artwork
- added fanart

v1.9.18
- Fixed mime-type for MPEG-TS
Expand Down
35 changes: 30 additions & 5 deletions addons/pvr.nextpvr/src/pvrclient-nextpvr.cpp
Expand Up @@ -382,7 +382,11 @@ PVR_ERROR cPVRClientNextPVR::GetEpg(ADDON_HANDLE handle, const PVR_CHANNEL &chan
broadcast.startTime = atol(start);
broadcast.endTime = atol(end);
broadcast.strPlot = description;
broadcast.strIconPath = "";

// artwork URL
char artworkPath[128];
snprintf(artworkPath, sizeof(artworkPath), "/service?method=channel.show.artwork&sid=%s&event_id=%d", m_sid, broadcast.iUniqueBroadcastId);
broadcast.strIconPath = artworkPath;

char genre[128];
genre[0] = '\0';
Expand Down Expand Up @@ -547,6 +551,12 @@ PVR_ERROR cPVRClientNextPVR::GetChannels(ADDON_HANDLE handle, bool bRadio)
tag.iUniqueId = atoi(pChannelNode->FirstChildElement("id")->FirstChild()->Value());
tag.iChannelNumber = atoi(pChannelNode->FirstChildElement("number")->FirstChild()->Value());

// handle major.minor style subchannels
if (pChannelNode->FirstChildElement("minor"))
{
tag.iSubChannelNumber = atoi(pChannelNode->FirstChildElement("minor")->FirstChild()->Value());
}

PVR_STRCPY(tag.strChannelName, pChannelNode->FirstChildElement("name")->FirstChild()->Value());

// check if we need to download a channel icon
Expand Down Expand Up @@ -744,6 +754,14 @@ PVR_ERROR cPVRClientNextPVR::GetRecordings(ADDON_HANDLE handle)
{
tag.iLastPlayedPosition = atoi(pRecordingNode->FirstChildElement("playback_position")->FirstChild()->Value());
}

char artworkPath[512];
snprintf(artworkPath, sizeof(artworkPath), "http://%s:%d/service?method=recording.artwork&sid=%s&recording_id=%s", g_szHostname.c_str(), g_iPort, m_sid, tag.strRecordingId);
PVR_STRCPY(tag.strIconPath, artworkPath);
PVR_STRCPY(tag.strThumbnailPath, artworkPath);

snprintf(artworkPath, sizeof(artworkPath), "http://%s:%d/service?method=recording.fanart&sid=%s&recording_id=%s", g_szHostname.c_str(), g_iPort, m_sid, tag.strRecordingId);
PVR_STRCPY(tag.strFanartPath, artworkPath);

CStdString strStream;
strStream.Format("http://%s:%d/live?recording=%s", g_szHostname, g_iPort, tag.strRecordingId);
Expand Down Expand Up @@ -1210,11 +1228,18 @@ bool cPVRClientNextPVR::OpenLiveStream(const PVR_CHANNEL &channelinfo)
delete m_pLiveShiftSource;
m_pLiveShiftSource = NULL;
}


char mode[32];
memset(mode, 0, sizeof(mode));
if (channelinfo.bIsRadio == false && m_supportsLiveTimeshift && g_bUseTimeshift)
strcpy(mode, "&mode=liveshift");

char line[256];
sprintf(line, "GET /live?channel=%d&client=XBMC-%s HTTP/1.0\r\n", channelinfo.iChannelNumber, m_sid);
if (m_supportsLiveTimeshift && g_bUseTimeshift)
sprintf(line, "GET /live?channel=%d&mode=liveshift&client=XBMC-%s HTTP/1.0\r\n", channelinfo.iChannelNumber, m_sid);
if (channelinfo.iSubChannelNumber == 0)
sprintf(line, "GET /live?channel=%d%s&client=XBMC-%s HTTP/1.0\r\n", channelinfo.iChannelNumber, mode, m_sid);
else
sprintf(line, "GET /live?channel=%d.%d%s&client=XBMC-%s HTTP/1.0\r\n", channelinfo.iChannelNumber, channelinfo.iSubChannelNumber, mode, m_sid);

m_streamingclient->send(line, strlen(line));

sprintf(line, "Connection: close\r\n");
Expand Down

0 comments on commit a223ae3

Please sign in to comment.