summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index c2087b7c35..6c04321539 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1702,13 +1702,11 @@ void LLViewerMediaImpl::destroyMediaSource()
cancelMimeTypeProbe();
- mLock.lock(); // Delay tear-down while bg thread is updating
if(mMediaSource)
{
mMediaSource->setDeleteOK(true) ;
mMediaSource = NULL; // shared pointer
}
- mLock.unlock();
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -2903,11 +2901,16 @@ void LLViewerMediaImpl::update()
return;
}
+
// Push update to worker thread
auto main_queue = LLMediaTextureUpdateThread::sEnabled ? mMainQueue.lock() : nullptr;
ref(); // protect texture from deletion while active on bg queue
if (main_queue)
{
+ // replace GL name
+ //llassert(!mTextureId.isNull());
+ //LLImageGL* base_image = LLViewerTextureManager::getMediaTexture(mTextureId)->getGLTexture();
+ //GLuint retired_name = base_image->allocNew();
main_queue->postTo(
mTexUpdateQueue, // Worker thread queue
[this]() // work done on update worker thread
@@ -2931,12 +2934,12 @@ void LLViewerMediaImpl::update()
void LLViewerMediaImpl::doMediaTexUpdate()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_MEDIA;
- mLock.lock(); // don't allow media source tear-down during update
-
LLViewerMediaTexture* media_tex = updateMediaImage();
if (media_tex && mMediaSource)
{
+ llassert(mMediaSource);
+
LLRect dirty_rect;
S32 media_width = mMediaSource->getTextureWidth();
S32 media_height = mMediaSource->getTextureHeight();
@@ -2984,7 +2987,6 @@ void LLViewerMediaImpl::doMediaTexUpdate()
mMediaSource->resetDirty();
}
}
- mLock.unlock();
}
//////////////////////////////////////////////////////////////////////////////////////////