diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2015-08-31 15:48:29 +0200 |
---|---|---|
committer | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2015-08-31 15:48:29 +0200 |
commit | 23bc0c1a8fb8888a8057de10ff93008ddbd392f3 (patch) | |
tree | 81bd4f854abcb442de9cb30c58aec10740c634ef | |
parent | ef3ea04400bb561d8407bedbd2894c76a4db94ef (diff) | |
parent | 7640734d57be359f4fa165458879b6b49372f2f0 (diff) |
Merge pull request #7933 from Paxxi/pvrchannelgroup
[PVR] Fix: Change parameter to CPVRChannelPtr
-rw-r--r-- | xbmc/pvr/channels/PVRChannelGroup.cpp | 24 | ||||
-rw-r--r-- | xbmc/pvr/channels/PVRChannelGroup.h | 4 |
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 |