Ticket #1399: vorbis.diff

File vorbis.diff, 1.0 KB (added by eriktorbjorn, 21 years ago)

Ugly hack against a January 20 CVS snapshot

  • scummvm/sound/vorbis.cpp

    diff -ur --exclude=CVS ScummVM/scummvm/sound/vorbis.cpp ScummVM+hack/scummvm/sound/vorbis.cpp
    old new  
    173173        const int16 *_bufferEnd;
    174174        const int16 *_pos;
    175175        int _played;
     176        uint32 _readBufferTime;
    176177       
    177178        void refill();
    178179        inline bool eosIntern() const;
     
    185186        bool isStereo() const           { return _numChannels >= 2; }
    186187       
    187188        int getRate() const                     { return ov_info(_ov_file, -1)->rate; }
    188         int getSamplesPlayed() const { return _played / _numChannels; }
     189        int getSamplesPlayed() const {
     190                return (_played / _numChannels) + (((g_system->get_msecs() - _readBufferTime) * getRate()) / 1000);
     191        }
    189192
    190193};
    191194
     
    209212
    210213        // Read in initial data
    211214        refill();
     215
     216        _readBufferTime = g_system->get_msecs();
    212217}
    213218
    214219inline int16 VorbisInputStream::read() {
     
    239244                }
    240245        }
    241246        _played += samples;
     247        _readBufferTime = g_system->get_msecs();
    242248        return samples;
    243249}
    244250