Skip to content

Commit

Permalink
[cec] Temp - more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Oct 26, 2016
1 parent 2397aad commit 190347d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xbmc/peripherals/devices/PeripheralCecAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,12 +801,15 @@ void CPeripheralCecAdapter::GetNextKey(void)

void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key)
{
CLog::Log(LOGDEBUG, "%s - received key %2x duration %d", __FUNCTION__, key.iButton, key.iDuration);
CLog::Log(LOGDEBUG, "%s - received key %2x duration %d (rep:%d size:%d)", __FUNCTION__, key.iButton, key.iDuration, m_configuration.iButtonRepeatRateMs, m_buttonQueue.size());

CSingleLock lock(m_critSection);
// avoid the queue getting too long
if (m_configuration.iButtonRepeatRateMs && m_buttonQueue.size() > 5)
{
CLog::Log(LOGDEBUG, "%s - discarded key %2x", __FUNCTION__, key.iButton);
return;
}
if (m_configuration.iButtonRepeatRateMs == 0 && key.iDuration > 0)
{
if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0)
Expand All @@ -815,6 +818,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key)
if (m_bHasButton)
m_currentButton.iDuration = key.iDuration;
// ignore this one, since it's already been handled by xbmc
CLog::Log(LOGDEBUG, "%s - ignored key %2x", __FUNCTION__, key.iButton);
return;
}
// if we received a keypress with a duration set, try to find the same one without a duration set, and replace it
Expand All @@ -825,6 +829,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key)
if ((*it).iDuration == 0)
{
// replace this entry
CLog::Log(LOGDEBUG, "%s - replaced key %2x", __FUNCTION__, key.iButton);
(*it).iDuration = key.iDuration;
return;
}
Expand All @@ -834,6 +839,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const CecButtonPress &key)
}
}

CLog::Log(LOGDEBUG, "%s - added key %2x", __FUNCTION__, key.iButton);
m_buttonQueue.push_back(key);
}

Expand Down

0 comments on commit 190347d

Please sign in to comment.