summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/quicktime/media_plugin_quicktime.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
index fbda65120d..556865f771 100644
--- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
+++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
@@ -103,6 +103,7 @@ private:
message.setValueReal("current_time", getCurrentTime());
message.setValueReal("duration", getDuration());
message.setValueReal("current_rate", Fix2X(GetMovieRate(mMovieHandle)));
+ message.setValueReal("loaded_duration", getLoadedDuration());
}
sendMessage(message);
@@ -593,6 +594,19 @@ private:
return (F64)duration / (F64)scale;
};
+ 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 getCurrentTime()
{
TimeValue curr_time = GetMovieTime( mMovieHandle, 0 );