aboutsummaryrefslogtreecommitdiff
path: root/video/video_decoder.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2012-08-16 12:27:05 -0400
committerMatthew Hoops2012-08-16 12:27:05 -0400
commit9e7f0e4753636ace510d626be4b0ee22ab682269 (patch)
tree247ce975c21f3c54550aad255d22bf3eab944fe7 /video/video_decoder.cpp
parent7294a1cbcf1cf5e8c846faf8838e537bd8c638dc (diff)
downloadscummvm-rg350-9e7f0e4753636ace510d626be4b0ee22ab682269.tar.gz
scummvm-rg350-9e7f0e4753636ace510d626be4b0ee22ab682269.tar.bz2
scummvm-rg350-9e7f0e4753636ace510d626be4b0ee22ab682269.zip
VIDEO: Begin removing some of the deprecated functions from VideoDecoder
Diffstat (limited to 'video/video_decoder.cpp')
-rw-r--r--video/video_decoder.cpp40
1 files changed, 5 insertions, 35 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index 0108888613..a7d3789b65 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -34,7 +34,10 @@
namespace Video {
VideoDecoder::VideoDecoder() {
- reset();
+ _startTime = 0;
+ _pauseLevel = 0;
+ _audioVolume = Audio::Mixer::kMaxChannelVolume;
+ _audioBalance = 0;
}
bool VideoDecoder::loadFile(const Common::String &filename) {
@@ -74,7 +77,7 @@ void VideoDecoder::pauseVideo(bool pause) {
pauseVideoIntern(true);
} else if (_pauseLevel == 0) {
pauseVideoIntern(false);
- addPauseTime(g_system->getMillis() - _pauseStartTime);
+ _startTime += (g_system->getMillis() - _pauseStartTime);
}
}
@@ -701,41 +704,8 @@ void AdvancedVideoDecoder::startAudioLimit(const Audio::Timestamp &limit) {
///////////////// DEPRECATED /////////////////
//////////////////////////////////////////////
-void VideoDecoder::reset() {
- _curFrame = -1;
- _startTime = 0;
- _pauseLevel = 0;
- _audioVolume = Audio::Mixer::kMaxChannelVolume;
- _audioBalance = 0;
-}
-
-bool VideoDecoder::endOfVideo() const {
- return !isVideoLoaded() || (getCurFrame() >= (int32)getFrameCount() - 1);
-}
-
void VideoDecoder::setSystemPalette() {
g_system->getPaletteManager()->setPalette(getPalette(), 0, 256);
}
-uint32 FixedRateVideoDecoder::getTimeToNextFrame() const {
- if (endOfVideo() || _curFrame < 0)
- return 0;
-
- uint32 elapsedTime = getTime();
- uint32 nextFrameStartTime = getFrameBeginTime(_curFrame + 1);
-
- // If the time that the next frame should be shown has past
- // the frame should be shown ASAP.
- if (nextFrameStartTime <= elapsedTime)
- return 0;
-
- return nextFrameStartTime - elapsedTime;
-}
-
-uint32 FixedRateVideoDecoder::getFrameBeginTime(uint32 frame) const {
- Common::Rational beginTime = frame * 1000;
- beginTime /= getFrameRate();
- return beginTime.toInt();
-}
-
} // End of namespace Video