From 321f286a6d3471417158a2833aa5ea20e751a207 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 6 Apr 2020 17:17:49 +0200 Subject: [PATCH] re-introduce PROTMESSID_OPUS_SUPPORTED message to support older client versions --- src/channel.cpp | 1 + src/protocol.cpp | 12 ++++++++++++ src/protocol.h | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/channel.cpp b/src/channel.cpp index 05ac3550..75829284 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -350,6 +350,7 @@ void CChannel::OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTranspor if ( ( NetworkTransportProps.eAudioCodingType != CT_OPUS ) && ( NetworkTransportProps.eAudioCodingType != CT_OPUS64 ) ) { + Protocol.CreateOpusSupportedMes(); return; } diff --git a/src/protocol.cpp b/src/protocol.cpp index 7120274d..de15bb84 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -154,6 +154,12 @@ MESSAGES (with connection) +---------------------+ +// #### COMPATIBILITY OLD VERSION, TO BE REMOVED #### +- PROTMESSID_OPUS_SUPPORTED: Informs that OPUS codec is supported + + note: does not have any data -> n = 0 + + CONNECTION LESS MESSAGES ------------------------ @@ -1222,6 +1228,12 @@ bool CProtocol::EvaluateLicenceRequiredMes ( const CVector& vecData ) return false; // no error } +void CProtocol::CreateOpusSupportedMes() +{ + CreateAndSendMessage ( PROTMESSID_OPUS_SUPPORTED, + CVector ( 0 ) ); +} + // Connection less messages ---------------------------------------------------- void CProtocol::CreateCLPingMes ( const CHostAddress& InetAddr, const int iMs ) diff --git a/src/protocol.h b/src/protocol.h index 59ed83ac..617092c0 100755 --- a/src/protocol.h +++ b/src/protocol.h @@ -52,7 +52,7 @@ #define PROTMESSID_REQ_CHANNEL_INFOS 23 // request channel infos for fader tag #define PROTMESSID_CONN_CLIENTS_LIST 24 // channel infos for connected clients #define PROTMESSID_CHANNEL_INFOS 25 // set channel infos -#define PROTMESSID_OPUS_SUPPORTED 26 // OLD (not used anymore) +#define PROTMESSID_OPUS_SUPPORTED 26 // tells that OPUS codec is supported #define PROTMESSID_LICENCE_REQUIRED 27 // licence required // message IDs of connection less messages (CLM) @@ -101,6 +101,7 @@ public: void CreateNetwTranspPropsMes ( const CNetworkTransportProps& NetTrProps ); void CreateReqNetwTranspPropsMes(); void CreateLicenceRequiredMes ( const ELicenceType eLicenceType ); + void CreateOpusSupportedMes(); void CreateCLPingMes ( const CHostAddress& InetAddr, const int iMs ); void CreateCLPingWithNumClientsMes ( const CHostAddress& InetAddr,