VIDEO: Implement rewinding Smacker audio tracks
This commit is contained in:
parent
7af4e40304
commit
6c155b6b36
2 changed files with 9 additions and 1 deletions
|
@ -410,7 +410,6 @@ void SmackerDecoder::close() {
|
|||
|
||||
bool SmackerDecoder::rewind() {
|
||||
// Call the parent method to rewind the tracks first
|
||||
// In particular, only videos without sound can be rewound
|
||||
if (!VideoDecoder::rewind())
|
||||
return false;
|
||||
|
||||
|
@ -755,6 +754,12 @@ SmackerDecoder::SmackerAudioTrack::~SmackerAudioTrack() {
|
|||
delete _audioStream;
|
||||
}
|
||||
|
||||
bool SmackerDecoder::SmackerAudioTrack::rewind() {
|
||||
delete _audioStream;
|
||||
_audioStream = Audio::makeQueuingAudioStream(_audioInfo.sampleRate, _audioInfo.isStereo);
|
||||
return true;
|
||||
}
|
||||
|
||||
Audio::AudioStream *SmackerDecoder::SmackerAudioTrack::getAudioStream() const {
|
||||
return _audioStream;
|
||||
}
|
||||
|
|
|
@ -156,6 +156,9 @@ private:
|
|||
SmackerAudioTrack(const AudioInfo &audioInfo, Audio::Mixer::SoundType soundType);
|
||||
~SmackerAudioTrack();
|
||||
|
||||
bool isRewindable() const { return true; }
|
||||
bool rewind();
|
||||
|
||||
Audio::Mixer::SoundType getSoundType() const { return _soundType; }
|
||||
|
||||
void queueCompressedBuffer(byte *buffer, uint32 bufferSize, uint32 unpackedSize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue