[Vorbis-dev] Continued:How can I seek in Ogg Vorbis file, but not using Vorbisfile library?

隽 徐 china_xujun at yahoo.com.cn
Wed Aug 30 01:38:50 PDT 2006


Hello, All.
   
  First, I want to thank Ian Malone and Ralph Giles, thanks for your kind replies. But I still have problems about seek.
   
  As you suggested, I could use ov_open_callbacks() to supply my own read/write/seek functions. So, can you give me an example? I’m sorry for my ignorance, because I haven’t used callbacks before.
   
  I analyzed the vorbisfile.c in Tremor, and I think I need more specific information about the seek algorithm. As far as I know, I could use ogg_sync_pageseek() function to find the next page; if it returns 0, that means I need to read more data; if it returns n, that means the page was synced at the current location with a page length of n bytes, so the location is where the “Oggs” is, am I right? And if it returns -n, does it mean I already skipped n bytes from the start point or I need to skip back n bytes to get the sync page? 
   
  Also, if I find the sync page, I must update the decode engine, the structures, like ogg_page, ogg_packet, etc need to get a new value, is that right? Then, there is another problem. I might have passed several segments of a packet, but the packet is not finished, so the next page starts with segments of the last packet. Can these segments be decoded? Or I must find the next packet? If so, how can I do it? I think granulepos is not very helpful in this case.
   
  Hope you can give me more information. Thank you all.
   
  Best wishes,
  Susan 

 		
---------------------------------
 Mp3疯狂搜-新歌热歌高速下   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20060830/86d613de/attachment.htm


More information about the Vorbis-dev mailing list