alarm/xbmc-rbp-git add CEC patch for certain panasonic TVs

This commit is contained in:
moonman 2014-01-24 15:44:10 -07:00
parent 5a327f682a
commit b707b0087f
2 changed files with 84 additions and 9 deletions

View file

@ -5,7 +5,7 @@
buildarch=16
pkgname=xbmc-rbp-git
pkgver=13.20140123
pkgver=13.20140124
pkgrel=1
pkgdesc="A software media player and entertainment hub for digital media for the Raspberry Pi"
arch=('armv6h')
@ -23,9 +23,12 @@ provides=("xbmc")
conflicts=("xbmc")
install="xbmc.install"
source=('xbmc.service'
'polkit.rules')
'polkit.rules'
'panasonicCEC.patch')
md5sums=('55e6d3aab86e810c49a7f550be5b7f69'
'db407faa4beb83b6368fc65ba9bc9507')
'db407faa4beb83b6368fc65ba9bc9507'
'a6c2fe4fc66b28f24cf49168692a78e9')
_gitname="xbmc"
_gitroot="git://github.com/xbmc"
@ -52,12 +55,11 @@ prepare() {
# fix lsb_release dependency
sed -i -e 's:/usr/bin/lsb_release -d:cat /etc/arch-release:' xbmc/utils/SystemInfo.cpp
# Change outdated macro use
# find . -name 'configure*' | xargs grep -l AM_CONFIG_HEADER | xargs sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g'
# Patch to fix TexturePacker build.
# patch -p1 -i ${srcdir}/xbmc-ae04d99-321-texturepacker-hostflags-and-rework.patch
# Suppress double keys within 250ms for some Panasonic TVs
# https://github.com/chbmuc/xbmc/commit/6e5822d4fe648abbd575cf77ced943a1461e9ae5
# http://archlinuxarm.org/forum/viewtopic.php?f=31&t=6376&start=10
patch -Np1 -i ${srcdir}/panasonicCEC.patch
# fix samba4 libsmbclient.h location

View file

@ -0,0 +1,73 @@
From 6e5822d4fe648abbd575cf77ced943a1461e9ae5 Mon Sep 17 00:00:00 2001
From: Christian Brunner <chb@muc.de>
Date: Sat, 18 Jan 2014 13:20:56 -0800
Subject: [PATCH] [cec] suppress double keys within 250ms
workaround for Panasonic's cec implementation
---
xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 16 ++++++++++++----
xbmc/peripherals/devices/PeripheralCecAdapter.h | 1 +
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
index 8919380..4bf5f89 100644
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
@@ -56,6 +56,9 @@
#define LOCALISED_ID_TV_AVR 36039
#define LOCALISED_ID_NONE 231
+/* time in milliseconds to suppress a double key press */
+#define CEC_SUPPRESS_DOUBLE_KEY 250
+
/* time in seconds to suppress source activation after receiving OnStop */
#define CEC_SUPPRESS_ACTIVATE_SOURCE_AFTER_ON_STOP 2
@@ -765,16 +768,20 @@ 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 timestamp %i", __FUNCTION__, key.iButton, key.iDuration, key.iTimestamp);
CSingleLock lock(m_critSection);
+ if (key.iDuration == 0 && key.iTimestamp - m_currentButton.iTimestamp < CEC_SUPPRESS_DOUBLE_KEY )
+ if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0)
+ // ignore this one, since it's already been handled by xbmc (workaround for buggy tv)
+ return;
+
if (key.iDuration > 0)
{
if (m_currentButton.iButton == key.iButton && m_currentButton.iDuration == 0)
{
- // update the duration
- if (m_bHasButton)
- m_currentButton.iDuration = key.iDuration;
+ // update the duration
+ m_currentButton.iDuration = key.iDuration;
// ignore this one, since it's already been handled by xbmc
return;
}
@@ -802,6 +809,7 @@ void CPeripheralCecAdapter::PushCecKeypress(const cec_keypress &key)
{
CecButtonPress xbmcKey;
xbmcKey.iDuration = key.duration;
+ xbmcKey.iTimestamp = XbmcThreads::SystemClockMillis();
switch (key.keycode)
{
diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.h b/xbmc/peripherals/devices/PeripheralCecAdapter.h
index 0809b03..cfd4ba9 100644
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.h
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.h
@@ -72,6 +72,7 @@
{
int iButton;
unsigned int iDuration;
+ unsigned int iTimestamp;
} CecButtonPress;
typedef enum
--
1.8.5.1