From 04562a6ca5bcba2852a962c9aa40fc052030e411 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 15 Aug 2021 11:36:08 +0100 Subject: [PATCH] Add a bit of logging for creating/destruction of opus --- audiohandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/audiohandler.cpp b/audiohandler.cpp index e05b226..01c4f8b 100644 --- a/audiohandler.cpp +++ b/audiohandler.cpp @@ -43,9 +43,11 @@ audioHandler::~audioHandler() qDebug(logAudio()) << "Resampler closed"; } if (encoder != Q_NULLPTR) { + qInfo(logAudio()) << "Destroying opus encoder"; opus_encoder_destroy(encoder); } if (decoder != Q_NULLPTR) { + qInfo(logAudio()) << "Destroying opus decoder"; opus_decoder_destroy(decoder); } } @@ -254,6 +256,7 @@ bool audioHandler::init(audioSetup setupIn) opus_encoder_ctl(encoder, OPUS_SET_INBAND_FEC(1)); opus_encoder_ctl(encoder, OPUS_SET_DTX(1)); opus_encoder_ctl(encoder, OPUS_SET_PACKET_LOSS_PERC(5)); + qInfo(logAudio()) << "Creating opus encoder: " << opus_strerror(opus_err); } } else { @@ -261,15 +264,12 @@ bool audioHandler::init(audioSetup setupIn) if (setup.codec == 0x40 || setup.codec == 0x80) { // Opus codec decoder = opus_decoder_create(setup.samplerate, setup.radioChan, &opus_err); + qInfo(logAudio()) << "Creating opus decoder: " << opus_strerror(opus_err); } } wf_resampler_get_ratio(resampler, &ratioNum, &ratioDen); qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "wf_resampler_init() returned: " << resample_error << " ratioNum" << ratioNum << " ratioDen" << ratioDen; - if (opus_err < 0) - { - qInfo(logAudio()) << "Faile to create opus" << (setup.isinput ? "Encoder" : "Decoder") << opus_strerror(opus_err); - } qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "thread id" << QThread::currentThreadId();