diff options
author | Dessie Linden <dessie@lindenlab.com> | 2010-06-17 07:42:08 -0700 |
---|---|---|
committer | Dessie Linden <dessie@lindenlab.com> | 2010-06-17 07:42:08 -0700 |
commit | 74817f151f3e5c2c0c179d13d1100974ed78fbd4 (patch) | |
tree | b198a5df57d362bfbd6c0617d14f5f7803ee5d6d /indra/newview/llviewermedia.cpp | |
parent | 1c15d18175782f5afee9377af3f0b4ca9e2a4db8 (diff) | |
parent | 7cc006347822a70f36175dc2627814a0eaeb9c0a (diff) |
Merged from q/viewer-release
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 14e58f4167..d7190f26a3 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1776,29 +1776,22 @@ void LLViewerMediaImpl::loadURI() llinfos << "Asking media source to load URI: " << uri << llendl; mMediaSource->loadURI( uri ); - + + // A non-zero mPreviousMediaTime means that either this media was previously unloaded by the priority code while playing/paused, + // or a seek happened before the media loaded. In either case, seek to the saved time. + if(mPreviousMediaTime != 0.0f) + { + seek(mPreviousMediaTime); + } + if(mPreviousMediaState == MEDIA_PLAYING) { // This media was playing before this instance was unloaded. - - if(mPreviousMediaTime != 0.0f) - { - // Seek back to where we left off, if possible. - seek(mPreviousMediaTime); - } - start(); } else if(mPreviousMediaState == MEDIA_PAUSED) { // This media was paused before this instance was unloaded. - - if(mPreviousMediaTime != 0.0f) - { - // Seek back to where we left off, if possible. - seek(mPreviousMediaTime); - } - pause(); } else @@ -1857,6 +1850,10 @@ void LLViewerMediaImpl::pause() { mMediaSource->pause(); } + else + { + mPreviousMediaState = MEDIA_PAUSED; + } } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1866,6 +1863,10 @@ void LLViewerMediaImpl::start() { mMediaSource->start(); } + else + { + mPreviousMediaState = MEDIA_PLAYING; + } } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1875,6 +1876,11 @@ void LLViewerMediaImpl::seek(F32 time) { mMediaSource->seek(time); } + else + { + // Save the seek time to be set when the media is loaded. + mPreviousMediaTime = time; + } } ////////////////////////////////////////////////////////////////////////////////////////// |