1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-08 11:03:30 +02:00

videoprovider: do not remove the FrameObject when unsubscribing

The end of the lifetime of the FrameObject should be determined by the underlying renderer.

Change-Id: I91026764a20a8451d6e71ffa98ee8cbea55272c4
This commit is contained in:
Andreas Traczyk 2023-05-29 18:19:48 -04:00
parent 5a48bccd25
commit da5d041227

View file

@ -103,27 +103,16 @@ VideoProvider::subscribe(QObject* obj, const QString& id)
void
VideoProvider::unsubscribe(QObject* obj)
{
QString id;
renderersMutex_.lockForRead();
QReadLocker lk(&renderersMutex_);
for (auto& pair : renderers_) {
QWriteLocker lock(&pair.second.subscribersMutex);
if (pair.second.subscribers.remove(static_cast<QVideoSink*>(obj))) {
qDebug().noquote() << QString("Removed sink: 0x%1 from subscribers for id: %2")
.arg((quintptr) obj, QT_POINTER_SIZE, 16, QChar('0'))
.arg(pair.first);
if (!pair.second.active && pair.second.subscribers.isEmpty())
id = pair.first;
break;
return;
}
}
renderersMutex_.unlock();
if (!id.isEmpty()) {
renderersMutex_.lockForWrite();
renderers_.erase(id);
renderersMutex_.unlock();
}
}
QString