diff options
author | Matthew Hoops | 2014-11-02 19:26:18 -0500 |
---|---|---|
committer | Matthew Hoops | 2014-11-02 20:15:06 -0500 |
commit | dfc3bcae20584b79f0b7ea2a6e4ccf0fed29797f (patch) | |
tree | 6f35fb4df8af4680d748e2b26912a953ec5f2b46 /video/avi_decoder.h | |
parent | 3f7566c7b183452a6203140b923d7e7a273369dd (diff) | |
download | scummvm-rg350-dfc3bcae20584b79f0b7ea2a6e4ccf0fed29797f.tar.gz scummvm-rg350-dfc3bcae20584b79f0b7ea2a6e4ccf0fed29797f.tar.bz2 scummvm-rg350-dfc3bcae20584b79f0b7ea2a6e4ccf0fed29797f.zip |
VIDEO: Separate AVI video and audio track reading
Relying on the videos to have 'initial frames' for audio tracks is not the best way to handle AVI videos. Now videos without initial frames (or broken interleaving) will buffer properly.
Diffstat (limited to 'video/avi_decoder.h')
-rw-r--r-- | video/avi_decoder.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/video/avi_decoder.h b/video/avi_decoder.h index 4461e537c5..eef127155e 100644 --- a/video/avi_decoder.h +++ b/video/avi_decoder.h @@ -216,6 +216,8 @@ protected: Audio::Mixer::SoundType getSoundType() const { return _soundType; } void skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime); void resetStream(); + uint32 getCurChunk() const { return _curChunk; } + void setCurChunk(uint32 chunk) { _curChunk = chunk; } bool isRewindable() const { return true; } bool rewind(); @@ -238,6 +240,15 @@ protected: Audio::Mixer::SoundType _soundType; Audio::QueuingAudioStream *_audStream; Audio::QueuingAudioStream *createAudioStream(); + uint32 _curChunk; + }; + + struct TrackStatus { + TrackStatus(); + + Track *track; + uint32 index; + uint32 chunkSearchOffset; }; AVIHeader _header; @@ -260,9 +271,12 @@ protected: void handleStreamHeader(uint32 size); uint16 getStreamType(uint32 tag) const { return tag & 0xFFFF; } byte getStreamIndex(uint32 tag) const; - void forceVideoEnd(); void checkTruemotion1(); + void handleNextPacket(TrackStatus& status); + bool shouldQueueAudio(TrackStatus& status); + Common::Array<TrackStatus> _videoTracks, _audioTracks; + public: virtual AVIAudioTrack *createAudioTrack(AVIStreamHeader sHeader, PCMWaveFormat wvInfo); }; |