mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 03:53:23 +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:
parent
5a48bccd25
commit
da5d041227
1 changed files with 2 additions and 13 deletions
|
@ -103,27 +103,16 @@ VideoProvider::subscribe(QObject* obj, const QString& id)
|
||||||
void
|
void
|
||||||
VideoProvider::unsubscribe(QObject* obj)
|
VideoProvider::unsubscribe(QObject* obj)
|
||||||
{
|
{
|
||||||
QString id;
|
QReadLocker lk(&renderersMutex_);
|
||||||
|
|
||||||
renderersMutex_.lockForRead();
|
|
||||||
for (auto& pair : renderers_) {
|
for (auto& pair : renderers_) {
|
||||||
QWriteLocker lock(&pair.second.subscribersMutex);
|
QWriteLocker lock(&pair.second.subscribersMutex);
|
||||||
if (pair.second.subscribers.remove(static_cast<QVideoSink*>(obj))) {
|
if (pair.second.subscribers.remove(static_cast<QVideoSink*>(obj))) {
|
||||||
qDebug().noquote() << QString("Removed sink: 0x%1 from subscribers for id: %2")
|
qDebug().noquote() << QString("Removed sink: 0x%1 from subscribers for id: %2")
|
||||||
.arg((quintptr) obj, QT_POINTER_SIZE, 16, QChar('0'))
|
.arg((quintptr) obj, QT_POINTER_SIZE, 16, QChar('0'))
|
||||||
.arg(pair.first);
|
.arg(pair.first);
|
||||||
if (!pair.second.active && pair.second.subscribers.isEmpty())
|
return;
|
||||||
id = pair.first;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
renderersMutex_.unlock();
|
|
||||||
|
|
||||||
if (!id.isEmpty()) {
|
|
||||||
renderersMutex_.lockForWrite();
|
|
||||||
renderers_.erase(id);
|
|
||||||
renderersMutex_.unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
|
|
Loading…
Add table
Reference in a new issue