aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-03-21 18:27:10 -0400
committerMatthew Hoops2011-03-21 18:27:10 -0400
commit94c27e4657279aaae8c98aee58477265625b7a27 (patch)
tree5b4eb02b5afe8380813131e544156cf79db1db4c
parent40c496d7301d1c0c6e80bfb0b5851a851237e167 (diff)
downloadscummvm-rg350-94c27e4657279aaae8c98aee58477265625b7a27.tar.gz
scummvm-rg350-94c27e4657279aaae8c98aee58477265625b7a27.tar.bz2
scummvm-rg350-94c27e4657279aaae8c98aee58477265625b7a27.zip
VIDEO: Add a getDuration() function to SeekableVideoDecoder
This function returns the total duration of the video
-rw-r--r--video/qt_decoder.h1
-rw-r--r--video/video_decoder.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index e876097dfd..f11689e021 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -122,6 +122,7 @@ public:
// SeekableVideoDecoder API
void seekToFrame(uint32 frame);
void seekToTime(Audio::Timestamp time);
+ uint32 getDuration() const { return _duration * 1000 / _timeScale; }
private:
// This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream.
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 97cd133bc0..348b5dc0a3 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -266,6 +266,11 @@ public:
* Implementation of RewindableVideoDecoder::rewind().
*/
virtual void rewind() { seekToTime(0); }
+
+ /**
+ * Get the total duration of the video (in ms).
+ */
+ virtual uint32 getDuration() const = 0;
};
} // End of namespace Video