realign to page on sync loss

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6645 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2004-02-19 05:26:42 +00:00
parent 16fe6dd90f
commit 6db6a6824b

View File

@ -155,6 +155,7 @@ OggSeekable::ReadPage(ogg_page * page, int read_size)
}
BAutolock autolock(fPositionLock);
// align to page boundary
align:
int offset;
while ((offset = ogg_sync_pageseek(&fSync, page)) <= 0) {
if (offset == 0) {
@ -204,9 +205,8 @@ OggSeekable::ReadPage(ogg_page * page, int read_size)
}
if (result == -1) {
TRACE("OggSeekable::ReadPage (%llu)\n", fPosition);
TRACE("OggSeekable::ReadPage: ogg_sync_pageout: not synced!\n");
debugger("lost sync");
return B_ERROR;
TRACE("OggSeekable::ReadPage: ogg_sync_pageout: not synced... attempt resync\n");
goto align;
}
if (ogg_page_version(page) != 0) {
TRACE("OggSeekable::ReadPage (%llu)\n", fPosition);