Commit 724ed9f0 authored by Emmanuel Milou's avatar Emmanuel Milou
parents f7e49a6b c30347cc
......@@ -83,28 +83,40 @@ Opus::getSDPChannels() const
int Opus::decode(SFLAudioSample *dst, unsigned char *buf, size_t buffer_size)
{
return opus_decode(decoder_, buf, buffer_size, dst, FRAME_SIZE, 0);
const int ret = opus_decode(decoder_, buf, buffer_size, dst, FRAME_SIZE, 0);
if (ret < 0)
std::cerr << opus_strerror(ret) << std::endl;
return ret;
}
int Opus::encode(unsigned char *dst, SFLAudioSample *src, size_t buffer_size)
{
return opus_encode(encoder_, src, FRAME_SIZE, dst, buffer_size * 2);
const int ret = opus_encode(encoder_, src, FRAME_SIZE, dst, buffer_size * 2);
if (ret < 0)
std::cerr << opus_strerror(ret) << std::endl;
return ret;
}
int Opus::decode(std::vector<std::vector<SFLAudioSample> > &dst, unsigned char *buf, size_t buffer_size)
{
if (buf == NULL) return 0;
unsigned samples = opus_decode(decoder_, buf, buffer_size, dst[0].data(), sizeof(SFLAudioSample) * FRAME_SIZE, 0);
const int ret = opus_decode(decoder_, buf, buffer_size, dst[0].data(), sizeof(SFLAudioSample) * FRAME_SIZE, 0);
if (ret < 0)
std::cerr << opus_strerror(ret) << std::endl;
return samples;
return ret;
}
int Opus::encode(unsigned char *dst, std::vector<std::vector<SFLAudioSample> > &src, size_t buffer_size)
{
if (dst == NULL) return 0;
return opus_encode(encoder_, src[0].data(), FRAME_SIZE, dst, buffer_size * sizeof(SFLAudioSample));
const int ret = opus_encode(encoder_, src[0].data(), FRAME_SIZE, dst, buffer_size * sizeof(SFLAudioSample));
if (ret < 0)
std::cerr << opus_strerror(ret) << std::endl;
return ret;
}
......
......@@ -115,7 +115,7 @@ SIPAccount::SIPAccount(const std::string& accountID, bool presenceEnabled)
, stunServer_("")
, stunEnabled_(false)
, srtpEnabled_(false)
, srtpKeyExchange_("sdes")
, srtpKeyExchange_("")
, srtpFallback_(false)
, zrtpDisplaySas_(true)
, zrtpDisplaySasOnce_(false)
......
......@@ -166,7 +166,7 @@ void show_advanced_tls_options(account_t *account, SFLPhoneClient *client)
gtk_grid_attach(GTK_GRID(grid), privateKeyFileChooser, 1, 5, 1, 1);
if (!tls_private_key_file) {
gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser));
gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(privateKeyFileChooser));
} else {
if (!*tls_private_key_file) {
gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(privateKeyFileChooser));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment