fix for loud noise at the beginning of a connection when a new server (supporting OPUS) is connected -> Still some noise left because of weird PLC effects of the OPUS codec

This commit is contained in:
Volker Fischer 2013-03-10 08:19:41 +00:00
parent cf0c9d192d
commit 961ae0f396
4 changed files with 25 additions and 3 deletions

View file

@ -65,18 +65,29 @@
#define AUD_REVERB_MAX 100 #define AUD_REVERB_MAX 100
// CELT number of coded bytes per audio packet // CELT number of coded bytes per audio packet
// 24: mono low/normal quality 156 kbsp (128) / 114 kbps (256) // 24: mono low/normal quality 156 kbps (128) / 114 kbps (256)
// 44: mono high quality 216 kbps (128) / 174 kbps (256) // 44: mono high quality 216 kbps (128) / 174 kbps (256)
// NOTE: Must be > CELT_MINIMUM_NUM_BYTES (greater, not equal to!) // NOTE: Must be > CELT_MINIMUM_NUM_BYTES (greater, not equal to!)
#define CELT_NUM_BYTES_MONO_NORMAL_QUALITY 24 #define CELT_NUM_BYTES_MONO_NORMAL_QUALITY 24
#define CELT_NUM_BYTES_MONO_HIGH_QUALITY 44 #define CELT_NUM_BYTES_MONO_HIGH_QUALITY 44
// 46: stereo low/normal quality 222 kbsp (128) / 180 kbps (256) // 46: stereo low/normal quality 222 kbps (128) / 180 kbps (256)
// 70: stereo high quality 294 kbps (128) / 252 kbps (256) // 70: stereo high quality 294 kbps (128) / 252 kbps (256)
#define CELT_NUM_BYTES_STEREO_NORMAL_QUALITY 46 #define CELT_NUM_BYTES_STEREO_NORMAL_QUALITY 46
#define CELT_NUM_BYTES_STEREO_HIGH_QUALITY 70 #define CELT_NUM_BYTES_STEREO_HIGH_QUALITY 70
// OPUS number of coded bytes per audio packet
// TODO we have to use new numbers for OPUS to avoid that old CELT packets
// are used in the OPUS decoder (which gives a bad noise output signal).
// Later on when the CELT is completely removed we could set the OPUS
// numbers back to the original CELT values (to reduce network load)
#define OPUS_NUM_BYTES_MONO_NORMAL_QUALITY 25
#define OPUS_NUM_BYTES_MONO_HIGH_QUALITY 45
#define OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY 47
#define OPUS_NUM_BYTES_STEREO_HIGH_QUALITY 71
/* Classes ********************************************************************/ /* Classes ********************************************************************/
class CClient : public QObject class CClient : public QObject
{ {
@ -364,6 +375,9 @@ signals:
int iPingTime, int iPingTime,
int iNumClients ); int iNumClients );
void Disconnected(); void Disconnected();
// #### COMPATIBILITY OLD VERSION, TO BE REMOVED ####
void UpstreamRateChanged();
}; };
#endif /* !defined ( CLIENT_HOIHGE76GEKJH98_3_43445KJIUHF1912__INCLUDED_ ) */ #endif /* !defined ( CLIENT_HOIHGE76GEKJH98_3_43445KJIUHF1912__INCLUDED_ ) */

View file

@ -59,6 +59,8 @@ public:
const int iOverallDelayMs, const int iOverallDelayMs,
const int iOverallDelayLEDColor ); const int iOverallDelayLEDColor );
void UpdateDisplay();
protected: protected:
void UpdateJitterBufferFrame(); void UpdateJitterBufferFrame();
void UpdateSoundCardFrame(); void UpdateSoundCardFrame();
@ -72,7 +74,6 @@ protected:
CClient* pClient; CClient* pClient;
QTimer TimerStatus; QTimer TimerStatus;
QButtonGroup SndCrdBufferDelayButtonGroup; QButtonGroup SndCrdBufferDelayButtonGroup;
void UpdateDisplay();
public slots: public slots:
void OnTimerStatus() { UpdateDisplay(); } void OnTimerStatus() { UpdateDisplay(); }

View file

@ -439,6 +439,10 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
SIGNAL ( CLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ), SIGNAL ( CLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ),
this, SLOT ( OnCLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ) ); this, SLOT ( OnCLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ) );
QObject::connect ( pClient,
SIGNAL ( UpstreamRateChanged() ),
this, SLOT ( OnUpstreamRateChanged() ) );
QObject::connect ( QCoreApplication::instance(), SIGNAL ( aboutToQuit() ), QObject::connect ( QCoreApplication::instance(), SIGNAL ( aboutToQuit() ),
this, SLOT ( OnAboutToQuit() ) ); this, SLOT ( OnAboutToQuit() ) );

View file

@ -167,6 +167,9 @@ public slots:
void OnDisconnected(); void OnDisconnected();
void OnUpstreamRateChanged()
{ ClientSettingsDlg.UpdateDisplay(); }
void OnGUIDesignChanged() void OnGUIDesignChanged()
{ SetGUIDesign ( pClient->GetGUIDesign() ); } { SetGUIDesign ( pClient->GetGUIDesign() ); }