mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 13:42:37 +00:00
VIDEO: Allow for disabling of automatic audio sync in AdvancedVideoDecoder
This commit is contained in:
parent
1d565a2661
commit
fc1163ac28
@ -194,12 +194,14 @@ uint32 AdvancedVideoDecoder::getTime() const {
|
||||
if (isPaused())
|
||||
return _pauseStartTime - _startTime;
|
||||
|
||||
for (TrackList::const_iterator it = _tracks.begin(); it != _tracks.end(); it++) {
|
||||
if ((*it)->getTrackType() == Track::kTrackTypeAudio) {
|
||||
uint32 time = ((const AudioTrack *)*it)->getRunningTime();
|
||||
if (useAudioSync()) {
|
||||
for (TrackList::const_iterator it = _tracks.begin(); it != _tracks.end(); it++) {
|
||||
if ((*it)->getTrackType() == Track::kTrackTypeAudio) {
|
||||
uint32 time = ((const AudioTrack *)*it)->getRunningTime();
|
||||
|
||||
if (time != 0)
|
||||
return time + _audioStartOffset.msecs();
|
||||
if (time != 0)
|
||||
return time + _audioStartOffset.msecs();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -625,6 +625,13 @@ protected:
|
||||
*/
|
||||
void addTrack(Track *track);
|
||||
|
||||
/**
|
||||
* Whether or not getTime() will sync with a playing audio track.
|
||||
*
|
||||
* A subclass should override this to disable this feature.
|
||||
*/
|
||||
virtual bool useAudioSync() const { return true; }
|
||||
|
||||
private:
|
||||
// Tracks owned by this AdvancedVideoDecoder
|
||||
typedef Common::List<Track *> TrackList;
|
||||
|
Loading…
x
Reference in New Issue
Block a user