Skip to content

Commit

Permalink
Version 3.4.3: fix channel playback.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksooo committed Jul 17, 2018
1 parent c5ee627 commit f4aac8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
1 change: 1 addition & 0 deletions pvr.stalker/changelog.txt
@@ -1,5 +1,6 @@
3.4.3
- Code cleanup
- Fix channel playback

3.4.2
- Updated language files from Transifex
Expand Down
18 changes: 5 additions & 13 deletions src/SData.cpp
Expand Up @@ -512,22 +512,14 @@ PVR_ERROR SData::GetChannels(ADDON_HANDLE handle, bool radio) {

PVR_ERROR SData::GetChannelStreamProperties(const PVR_CHANNEL* channel, PVR_NAMED_VALUE* properties, unsigned int* iPropertiesCount)
{
if (*iPropertiesCount < 2)
if (!channel || !properties || *iPropertiesCount < 2)
return PVR_ERROR_INVALID_PARAMETERS;

std::string strUrl;
std::vector<SC::Channel> channels;
channels = m_channelManager->GetChannels();
for (const auto& stalkerChannel : channels)
{
if (stalkerChannel.uniqueId == channel->iUniqueId)
{
strUrl = stalkerChannel.streamUrl;
}
}
if (strUrl.empty()) {
const std::string strUrl = GetChannelStreamURL(*channel);

if (strUrl.empty())
return PVR_ERROR_FAILED;
}

strncpy(properties[0].strName, PVR_STREAM_PROPERTY_STREAMURL, sizeof(properties[0].strName) - 1);
strncpy(properties[0].strValue, strUrl.c_str(), sizeof(properties[0].strValue) - 1);
strncpy(properties[1].strName, PVR_STREAM_PROPERTY_ISREALTIMESTREAM, sizeof(properties[1].strName) - 1);
Expand Down

0 comments on commit f4aac8e

Please sign in to comment.