Beispiel #1
0
void CPVRClients::SaveCurrentChannelSettings(void)
{
  CPVRChannelPtr channel;
  {
    CSingleLock lock(m_critSection);
    if (!GetPlayingChannel(channel) || !m_bIsValidChannelSettings)
      return;
  }

  CPVRDatabase *database = GetPVRDatabase();
  if (!database)
    return;

  if (g_settings.m_currentVideoSettings != g_settings.m_defaultVideoSettings)
  {
    CLog::Log(LOGDEBUG, "PVR - %s - persisting custom channel settings for channel '%s'",
        __FUNCTION__, channel->ChannelName().c_str());
    database->PersistChannelSettings(*channel, g_settings.m_currentVideoSettings);
  }
  else
  {
    CLog::Log(LOGDEBUG, "PVR - %s - no custom channel settings for channel '%s'",
        __FUNCTION__, channel->ChannelName().c_str());
    database->DeleteChannelSettings(*channel);
  }
}