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