aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/pvr/channels/PVRChannelGroup.cpp24
-rw-r--r--xbmc/pvr/channels/PVRChannelGroup.h4
2 files changed, 14 insertions, 14 deletions
diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp
index e8c5558401..47bafebf05 100644
--- a/xbmc/pvr/channels/PVRChannelGroup.cpp
+++ b/xbmc/pvr/channels/PVRChannelGroup.cpp
@@ -499,27 +499,27 @@ CFileItemPtr CPVRChannelGroup::GetByChannelNumber(unsigned int iChannelNumber, u
return retval;
}
-CFileItemPtr CPVRChannelGroup::GetByChannelUp(const CFileItem &channel) const
+CFileItemPtr CPVRChannelGroup::GetByChannelUp(const CPVRChannelPtr &channel) const
{
CFileItemPtr retval;
- if (channel.HasPVRChannelInfoTag())
+ if (channel)
{
CSingleLock lock(m_critSection);
for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_iterator it = m_sortedMembers.begin(); !retval && it != m_sortedMembers.end(); ++it)
{
- if ((*it).channel == channel.GetPVRChannelInfoTag())
+ if ((*it).channel == channel)
{
do
{
if ((++it) == m_sortedMembers.end())
it = m_sortedMembers.begin();
if ((*it).channel && !(*it).channel->IsHidden())
- retval = CFileItemPtr(new CFileItem((*it).channel));
- } while (!retval && (*it).channel != channel.GetPVRChannelInfoTag());
+ retval = std::make_shared<CFileItem>((*it).channel);
+ } while (!retval && (*it).channel != channel);
if (!retval)
- retval = CFileItemPtr(new CFileItem);
+ retval = std::make_shared<CFileItem>();
}
}
}
@@ -527,27 +527,27 @@ CFileItemPtr CPVRChannelGroup::GetByChannelUp(const CFileItem &channel) const
return retval;
}
-CFileItemPtr CPVRChannelGroup::GetByChannelDown(const CFileItem &channel) const
+CFileItemPtr CPVRChannelGroup::GetByChannelDown(const CPVRChannelPtr &channel) const
{
CFileItemPtr retval;
- if (channel.HasPVRChannelInfoTag())
+ if (channel)
{
CSingleLock lock(m_critSection);
for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::const_reverse_iterator it = m_sortedMembers.rbegin(); !retval && it != m_sortedMembers.rend(); ++it)
{
- if ((*it).channel == channel.GetPVRChannelInfoTag())
+ if ((*it).channel == channel)
{
do
{
if ((++it) == m_sortedMembers.rend())
it = m_sortedMembers.rbegin();
if ((*it).channel && !(*it).channel->IsHidden())
- retval = CFileItemPtr(new CFileItem((*it).channel));
- } while (!retval && (*it).channel != channel.GetPVRChannelInfoTag());
+ retval = std::make_shared<CFileItem>((*it).channel);
+ } while (!retval && (*it).channel != channel);
if (!retval)
- retval = CFileItemPtr(new CFileItem);
+ retval = std::make_shared<CFileItem>();
}
}
}
diff --git a/xbmc/pvr/channels/PVRChannelGroup.h b/xbmc/pvr/channels/PVRChannelGroup.h
index d8afebcbb8..ba9a74a7e7 100644
--- a/xbmc/pvr/channels/PVRChannelGroup.h
+++ b/xbmc/pvr/channels/PVRChannelGroup.h
@@ -314,14 +314,14 @@ namespace PVR
* @param channel The current channel.
* @return The channel or NULL if it wasn't found.
*/
- CFileItemPtr GetByChannelUp(const CFileItem &channel) const;
+ CFileItemPtr GetByChannelUp(const CPVRChannelPtr &channel) const;
/*!
* @brief Get the previous channel in this group.
* @param channel The current channel.
* @return The channel or NULL if it wasn't found.
*/
- CFileItemPtr GetByChannelDown(const CFileItem &channel) const;
+ CFileItemPtr GetByChannelDown(const CPVRChannelPtr &channel) const;
/*!
* Get the current members of this group