[Bug] iDoubleTapTimeoutMs not exists.

Hi. I can’t build it on Debian Jessie.

I got the following error:

/root/workspace/OpenPHT-1.5.0.502-7563ca94/xbmc/peripherals/devices/PeripheralCecAdapter.cpp: In member function ‘void PERIPHERALS::CPeripheralCecAdapter::SetConfigurationFromSettings()’:
/root/workspace/OpenPHT-1.5.0.502-7563ca94/xbmc/peripherals/devices/PeripheralCecAdapter.cpp:1382:19: error: ‘CEC::libcec_configuration’ has no member named ‘iDoubleTapTimeoutMs’
m_configuration.iDoubleTapTimeoutMs = GetSettingInt(“double_tap_timeout_ms”);

iDoubleTapTimeout50Ms not exists but iDoubleTapTimeout50Ms

So i modified /xbmc/peripherals/devices/PeripheralCecAdapter.cpp
This line:
m_configuration.iDoubleTapTimeoutMs = GetSettingInt(“double_tap_timeout_ms”);
To this:
m_configuration.iDoubleTapTimeout50Ms = 50 / GetSettingInt(“double_tap_timeout_ms”);

and now its buliding fine.

That may compile, because it satisfies syntax requirements and dependencies, but is it really correct ?

It looks to me as if you calculate the timeout in 50ms units by dividing 50 by the timeout in ms units, which will result in a frequency value in 20Hz units, rather than the time value in 50 ms units you were solving for.

I think you need to reverse the two terms in the calculation, to this:
m_configuration.iDoubleTapTimeout50Ms = GetSettingInt(“double_tap_timeout_ms”) / 50;

This conclusion is of course based on the assumption that the variable names really reflect the content.
Since I’m not familiar with the sources in question I can’t be 100% sure of that, but it seems logical…

Edit:
Some googling has now confirmed my guesswork above, as exactly the same calculation is made in some other sources I found. Apparently the problem is due to an update of libCEC whose older versions used 1ms units while the newer versions use 50ms units for this timeout value.

This also means that no bug is involved, but merely a mismatch of lib versions, which requires this change of time units for proper operation.

Best regards: dlanor