Browse Source

fix(coreav): cleanup assertions

It doesn't really make sense to assert that the callbacks are coming
from any other thread than CoreAV, when we actually want to ensure the
callback is coming from Core thread.

Remove over agressive assert from sendGroupCallAudio(...), this function
should be callable from any thread.

(cherry picked from commit 9499925fb2)
reviewable/pr6021/r1
sudden6 6 years ago committed by Anthony Bilinski
parent
commit
a4ac6d67c7
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 7
      src/core/coreav.cpp

7
src/core/coreav.cpp

@ -556,7 +556,6 @@ bool CoreAV::sendGroupCallAudio(int groupId, const int16_t* pcm, size_t samples,
uint32_t rate) const uint32_t rate) const
{ {
QMutexLocker locker{&callsLock}; QMutexLocker locker{&callsLock};
assert(QThread::currentThread() == coreavThread.get());
std::map<int, ToxGroupCallPtr>::const_iterator it = groupCalls.find(groupId); std::map<int, ToxGroupCallPtr>::const_iterator it = groupCalls.find(groupId);
if (it == groupCalls.end()) { if (it == groupCalls.end()) {
@ -680,8 +679,6 @@ bool CoreAV::isCallOutputMuted(const Friend* f) const
void CoreAV::sendNoVideo() void CoreAV::sendNoVideo()
{ {
QMutexLocker locker{&callsLock}; QMutexLocker locker{&callsLock};
// This callback should come from the Core thread
assert(QThread::currentThread() != coreavThread.get());
// We don't change the audio bitrate, but we signal that we're not sending video anymore // We don't change the audio bitrate, but we signal that we're not sending video anymore
qDebug() << "CoreAV: Signaling end of video sending"; qDebug() << "CoreAV: Signaling end of video sending";
@ -697,8 +694,6 @@ void CoreAV::callCallback(ToxAV* toxav, uint32_t friendNum, bool audio, bool vid
CoreAV* self = static_cast<CoreAV*>(vSelf); CoreAV* self = static_cast<CoreAV*>(vSelf);
QMutexLocker locker{&self->callsLock}; QMutexLocker locker{&self->callsLock};
// This callback should come from the Core thread
assert(QThread::currentThread() != self->coreavThread.get());
// Audio backend must be set before receiving a call // Audio backend must be set before receiving a call
assert(self->audio != nullptr); assert(self->audio != nullptr);
@ -728,8 +723,6 @@ void CoreAV::stateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t state, voi
{ {
Q_UNUSED(toxav); Q_UNUSED(toxav);
CoreAV* self = static_cast<CoreAV*>(vSelf); CoreAV* self = static_cast<CoreAV*>(vSelf);
// This callback should come from the Core thread
assert(QThread::currentThread() != self->coreavThread.get());
QMutexLocker locker{&self->callsLock}; QMutexLocker locker{&self->callsLock};

Loading…
Cancel
Save