cec: fixed serverVersion assignment that went out of scope in CECInitialise()
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 26 Apr 2012 12:50:41 +0000 (14:50 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 26 Apr 2012 12:50:45 +0000 (14:50 +0200)
include/cec.h
src/lib/CECProcessor.cpp
src/lib/LibCEC.cpp

index f656bb8665a7c70d697bf49afe82c4aedf35dd79..fada217ef52007f514013d9b05c4a6e18f7180a2 100644 (file)
@@ -36,6 +36,8 @@
 
 #include "cectypes.h"
 
+#define LIBCEC_VERSION_CURRENT CEC_SERVER_VERSION_1_6_2
+
 namespace CEC
 {
   class ICECAdapter
index 1c92bb1ba8b94b6f0bffcd443c618275b4750ed3..51fb764c40f5ac88f35c750e2f114a09acdf10d0 100644 (file)
@@ -61,7 +61,7 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, libcec_configuration *configur
 {
   CreateBusDevices();
   m_configuration.Clear();
-  m_configuration.serverVersion = CEC_SERVER_VERSION_1_6_2;
+  m_configuration.serverVersion = LIBCEC_VERSION_CURRENT;
   SetConfiguration(configuration);
 
   if (m_configuration.tvVendor != CEC_VENDOR_UNKNOWN)
@@ -79,7 +79,7 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, con
     m_iLastTransmission(0)
 {
   m_configuration.Clear();
-  m_configuration.serverVersion    = CEC_SERVER_VERSION_1_6_2;
+  m_configuration.serverVersion    = LIBCEC_VERSION_CURRENT;
 
   // client version < 1.5.0
   m_configuration.clientVersion    = (uint32_t)CEC_CLIENT_VERSION_PRE_1_5;
index 608375fe232954ffa61163a88f5bd43406040988..46decfb866aa8315d66778a531ddbbb30a6c5709 100644 (file)
@@ -540,6 +540,7 @@ void * CECInitialise(libcec_configuration *configuration)
 {
   CLibCEC *lib = new CLibCEC(configuration);
   CLibCEC::SetInstance(lib);
+  configuration->serverVersion = LIBCEC_VERSION_CURRENT;
   return static_cast< void* > (lib);
 }