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)