aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorMatthew Hoops2012-07-29 12:30:34 -0400
committerMatthew Hoops2012-07-29 12:38:51 -0400
commitdd10e7191e4b373513e5a6fa73daa6312bd81f62 (patch)
tree72e133a66ea5242c9840f615c57d3a2f7060fef1 /video
parent9cca8ac9f2f9162d4201d59c9ed8be5ae2a32a2b (diff)
downloadscummvm-rg350-dd10e7191e4b373513e5a6fa73daa6312bd81f62.tar.gz
scummvm-rg350-dd10e7191e4b373513e5a6fa73daa6312bd81f62.tar.bz2
scummvm-rg350-dd10e7191e4b373513e5a6fa73daa6312bd81f62.zip
VIDEO: Move Track's start()/stop() functions to AudioTrack
Diffstat (limited to 'video')
-rw-r--r--video/video_decoder.cpp26
-rw-r--r--video/video_decoder.h22
2 files changed, 24 insertions, 24 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index 131c86fdb8..84ce8144a0 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -268,7 +268,7 @@ bool AdvancedVideoDecoder::rewind() {
// Stop all tracks so they can be rewound
if (isPlaying())
- stopAllTracks();
+ stopAudio();
for (TrackList::iterator it = _tracks.begin(); it != _tracks.end(); it++)
if (!(*it)->rewind())
@@ -276,7 +276,7 @@ bool AdvancedVideoDecoder::rewind() {
// Now that we've rewound, start all tracks again
if (isPlaying())
- startAllTracks();
+ startAudio();
_audioStartOffset = 0;
_startTime = g_system->getMillis();
@@ -303,7 +303,7 @@ bool AdvancedVideoDecoder::seek(const Audio::Timestamp &time) {
// Stop all tracks so they can be seeked
if (isPlaying())
- stopAllTracks();
+ stopAudio();
for (TrackList::iterator it = _tracks.begin(); it != _tracks.end(); it++)
if (!(*it)->seek(time))
@@ -311,7 +311,7 @@ bool AdvancedVideoDecoder::seek(const Audio::Timestamp &time) {
// Now that we've seeked, start all tracks again
if (isPlaying())
- startAllTracks();
+ startAudio();
_audioStartOffset = time;
_startTime = g_system->getMillis() - time.msecs();
@@ -332,7 +332,7 @@ void AdvancedVideoDecoder::start() {
if (_needsRewind)
rewind();
- startAllTracks();
+ startAudio();
}
void AdvancedVideoDecoder::stop() {
@@ -346,7 +346,7 @@ void AdvancedVideoDecoder::stop() {
_dirtyPalette = false;
_needsUpdate = false;
- stopAllTracks();
+ stopAudio();
// Also reset the pause state.
_pauseLevel = 0;
@@ -532,8 +532,8 @@ void AdvancedVideoDecoder::addTrack(Track *track) {
track->pause(true);
// Start the track if we're playing
- if (isPlaying())
- track->start();
+ if (isPlaying() && track->getTrackType() == Track::kTrackTypeAudio)
+ ((AudioTrack *)track)->start();
}
bool AdvancedVideoDecoder::addStreamFileTrack(const Common::String &baseName) {
@@ -607,14 +607,16 @@ const AdvancedVideoDecoder::VideoTrack *AdvancedVideoDecoder::findNextVideoTrack
return bestTrack;
}
-void AdvancedVideoDecoder::startAllTracks() {
+void AdvancedVideoDecoder::startAudio() {
for (TrackList::iterator it = _tracks.begin(); it != _tracks.end(); it++)
- (*it)->start();
+ if ((*it)->getTrackType() == Track::kTrackTypeAudio)
+ ((AudioTrack *)*it)->start();
}
-void AdvancedVideoDecoder::stopAllTracks() {
+void AdvancedVideoDecoder::stopAudio() {
for (TrackList::iterator it = _tracks.begin(); it != _tracks.end(); it++)
- (*it)->stop();
+ if ((*it)->getTrackType() == Track::kTrackTypeAudio)
+ ((AudioTrack *)*it)->stop();
}
//////////////////////////////////////////////
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 3f5dc2c2ff..ad9825cb25 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -447,16 +447,6 @@ protected:
virtual bool seek(const Audio::Timestamp &time) { return false; }
/**
- * Start playback of the track.
- */
- virtual void start() {}
-
- /**
- * Stop playback of the track.
- */
- virtual void stop() {}
-
- /**
* Set the pause status of the track.
*/
void pause(bool shouldPause) {}
@@ -578,7 +568,15 @@ protected:
TrackType getTrackType() const { return kTrackTypeAudio; }
virtual bool endOfTrack() const;
+
+ /**
+ * Start playing this track
+ */
void start();
+
+ /**
+ * Stop playing this track
+ */
void stop();
/**
@@ -785,8 +783,8 @@ private:
Graphics::PixelFormat _defaultHighColorFormat;
// Internal helper functions
- void stopAllTracks();
- void startAllTracks();
+ void stopAudio();
+ void startAudio();
};
/**