From a364ef8f0fca2675f791a29ef231385e29945939 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 27 Jul 2012 11:01:21 -0400 Subject: [PATCH] VIDEO: Remove Track::getStartTime() That should be handled internally instead --- video/video_decoder.cpp | 17 ++++------------- video/video_decoder.h | 6 ------ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index 77eab3a6e1f..cea3960fee0 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -210,7 +210,7 @@ uint32 AdvancedVideoDecoder::getTime() const { uint32 time = ((const AudioTrack *)*it)->getRunningTime(); if (time != 0) - return time + (*it)->getStartTime().msecs() + _audioStartOffset.msecs(); + return time + _audioStartOffset.msecs(); } } } @@ -364,15 +364,10 @@ Audio::Timestamp AdvancedVideoDecoder::getDuration() const { Audio::Timestamp maxDuration(0, 1000); for (TrackList::const_iterator it = _tracks.begin(); it != _tracks.end(); it++) { - Audio::Timestamp startTime = (*it)->getStartTime(); Audio::Timestamp duration = (*it)->getDuration(); - if (duration.totalNumberOfFrames() != 0) { - // HACK: Timestamp's + operator doesn't do framerate conversion :( - duration = duration + startTime.convertToFramerate(duration.framerate()); - if (duration > maxDuration) - maxDuration = duration; - } + if (duration > maxDuration) + maxDuration = duration; } return maxDuration; @@ -406,11 +401,7 @@ bool AdvancedVideoDecoder::Track::isRewindable() const { } bool AdvancedVideoDecoder::Track::rewind() { - return seek(getStartTime()); -} - -Audio::Timestamp AdvancedVideoDecoder::Track::getStartTime() const { - return Audio::Timestamp(0, 1000); + return seek(Audio::Timestamp(0, 1000)); } Audio::Timestamp AdvancedVideoDecoder::Track::getDuration() const { diff --git a/video/video_decoder.h b/video/video_decoder.h index f0427668a60..18517c9ad2d 100644 --- a/video/video_decoder.h +++ b/video/video_decoder.h @@ -466,12 +466,6 @@ protected: */ bool isPaused() const { return _paused; } - /** - * Get the start time of the track (starting from the beginning of the - * movie). - */ - virtual Audio::Timestamp getStartTime() const; - /** * Get the duration of the track (starting from this track's start time). *