]> git.tdb.fi Git - libs/al.git/blobdiff - source/oggdecoder.cpp
Fix sound file signature comparisons
[libs/al.git] / source / oggdecoder.cpp
index 78a2b5ac158d20a857db455f7ee7e1e969b12922..374cf0b5ba06966174270a96c1d193a511843bcb 100644 (file)
@@ -106,12 +106,13 @@ bool OggDecoder::detect(const std::string &sig)
        static const char ogg_sig[] = { 'O', 'g', 'g', 'S' };
        if(sig.size()<sizeof(ogg_sig))
                return false;
-       return !sig.compare(0, sizeof(ogg_sig), ogg_sig);
+       return !sig.compare(0, sizeof(ogg_sig), ogg_sig, sizeof(ogg_sig));
 }
 
-void OggDecoder::rewind()
+void OggDecoder::seek(unsigned pos)
 {
-       ov_pcm_seek(&priv->ovfile, 0);
+       pos /= get_unit_size(format);
+       ov_pcm_seek(&priv->ovfile, pos);
 }
 
 unsigned OggDecoder::read(char *buf, unsigned len)