mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
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
)
This commit is contained in:
parent
89400c91f7
commit
a4ac6d67c7
|
@ -556,7 +556,6 @@ bool CoreAV::sendGroupCallAudio(int groupId, const int16_t* pcm, size_t samples,
|
|||
uint32_t rate) const
|
||||
{
|
||||
QMutexLocker locker{&callsLock};
|
||||
assert(QThread::currentThread() == coreavThread.get());
|
||||
|
||||
std::map<int, ToxGroupCallPtr>::const_iterator it = groupCalls.find(groupId);
|
||||
if (it == groupCalls.end()) {
|
||||
|
@ -680,8 +679,6 @@ bool CoreAV::isCallOutputMuted(const Friend* f) const
|
|||
void CoreAV::sendNoVideo()
|
||||
{
|
||||
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
|
||||
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);
|
||||
|
||||
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
|
||||
assert(self->audio != nullptr);
|
||||
|
@ -728,8 +723,6 @@ void CoreAV::stateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t state, voi
|
|||
{
|
||||
Q_UNUSED(toxav);
|
||||
CoreAV* self = static_cast<CoreAV*>(vSelf);
|
||||
// This callback should come from the Core thread
|
||||
assert(QThread::currentThread() != self->coreavThread.get());
|
||||
|
||||
QMutexLocker locker{&self->callsLock};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user