diff options
author | James Cook <james@lindenlab.com> | 2010-01-15 12:02:56 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-01-15 12:02:56 -0800 |
commit | 4acf56d2a79a4f3bb555977aeaef21e15e26f684 (patch) | |
tree | ac0d8ff2225916323d9b942246edd458e04fd738 /indra/newview/llviewermedia.cpp | |
parent | 3f83c05f7c71887825c907b0e148d81cd7de5324 (diff) | |
parent | c9cf84913d306103da51dc83e5932ff3fb308d32 (diff) |
Merge in viewer-2-0 changes
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f8502821f0..ef596f9297 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1006,6 +1006,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mInNearbyMediaList(false), mClearCache(false), mBackgroundColor(LLColor4::white), + mNavigateSuspended(false), + mNavigateSuspendedDeferred(false), mIsUpdated(false) { @@ -1696,6 +1698,13 @@ void LLViewerMediaImpl::navigateInternal() // Helpful to have media urls in log file. Shouldn't be spammy. llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl; + if(mNavigateSuspended) + { + llwarns << "Deferring navigate." << llendl; + mNavigateSuspendedDeferred = true; + return; + } + if(mMimeTypeProbe != NULL) { llwarns << "MIME type probe already in progress -- bailing out." << llendl; @@ -1902,7 +1911,17 @@ void LLViewerMediaImpl::update() return; } + // Make sure a navigate doesn't happen during the idle -- it can cause mMediaSource to get destroyed, which can cause a crash. + setNavigateSuspended(true); + mMediaSource->idle(); + + setNavigateSuspended(false); + + if(mMediaSource == NULL) + { + return; + } if(mMediaSource->isPluginExited()) { @@ -2559,6 +2578,23 @@ void LLViewerMediaImpl::setNavState(EMediaNavState state) } } +void LLViewerMediaImpl::setNavigateSuspended(bool suspend) +{ + if(mNavigateSuspended != suspend) + { + mNavigateSuspended = suspend; + if(!suspend) + { + // We're coming out of suspend. If someone tried to do a navigate while suspended, do one now instead. + if(mNavigateSuspendedDeferred) + { + mNavigateSuspendedDeferred = false; + navigateInternal(); + } + } + } +} + void LLViewerMediaImpl::cancelMimeTypeProbe() { if(mMimeTypeProbe != NULL) |