summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
authorcallum <none@none>2009-10-15 15:08:10 -0700
committercallum <none@none>2009-10-15 15:08:10 -0700
commit113053b504971cb36c7f67f4d0cd56983910a523 (patch)
tree8c59f08df68f3cb416313601a73ef303fde3bc4b /indra/media_plugins
parent12628429d8553cf242a38f820187552b6fe93628 (diff)
Fixed defects - added back getLoadedDuration() code that mysteriously vanished and fix name of function that checks the title.
See http://10.1.19.90:8080/go?page=ReviewDisplay&reviewid=19
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/quicktime/media_plugin_quicktime.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
index 9b378fcd92..7100d03f05 100644
--- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
+++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
@@ -532,7 +532,8 @@ private:
// update state machine
processState();
-titleChanged( "" );
+ // see if title arrived and if so, update member variable with contents
+ checkTitle();
// special code for looping - need to rewind at the end of the movie
if ( mIsLooping )
@@ -595,6 +596,19 @@ titleChanged( "" );
};
};
+ F64 getLoadedDuration()
+ {
+ TimeValue duration;
+ if(GetMaxLoadedTimeInMovie( mMovieHandle, &duration ) != noErr)
+ {
+ // If GetMaxLoadedTimeInMovie returns an error, return the full duration of the movie.
+ duration = GetMovieDuration( mMovieHandle );
+ }
+ TimeValue scale = GetMovieTimeScale( mMovieHandle );
+
+ return (F64)duration / (F64)scale;
+ };
+
F64 getDuration()
{
TimeValue duration = GetMovieDuration( mMovieHandle );
@@ -696,17 +710,23 @@ titleChanged( "" );
return true;
};
- // called by this plugin when the title changes
- // this creates the message and sends it back to the host app
- void titleChanged( std::string title )
+ // called regularly to see if title changed
+ void checkTitle()
{
+ // we did already receive title so keep checking
if ( ! mReceivedTitle )
{
+ // grab title from movie meta data
if ( getMovieTitle() )
{
+ // pass back to host application
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text");
message.setValue("name", mMovieTitle );
sendMessage( message );
+
+ // stop looking once we find a title for this movie.
+ // TODO: this may to be reset if movie title changes
+ // during playback but this is okay for now
mReceivedTitle = true;
};
};