Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bb4c0ab authored by Ray Essick's avatar Ray Essick
Browse files

improve performance of oggextractor::findNextPage()

instead of "test, advance 1, test", look at the 4 bytes that we
used in the test to see the soonest our test could possibly succeed
(e.g. where do we find the right leading character) and advance that
far instead of just 1.

Bug: 124238340
Test: manual
parent 1342d074
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -364,7 +364,13 @@ status_t MyOggExtractor::findNextPage(
            return OK;
        }

        ++*pageOffset;
        // see how far ahead to skip; avoid some fruitless comparisons
        unsigned int i;
        for (i = 1; i < 4 ; i++) {
            if (signature[i] == 'O')
                break;
        }
        *pageOffset += i;
    }
}