Don't try to decode more than 5 frames at a time to reach

the seek frame. It's just not such a good strategy, since
it appears to be faster to just wait until the next keyframe
is reached naturally.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38506 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-09-01 21:51:56 +00:00
parent 01aeac8c1f
commit 2cc22e8a26

View File

@ -42,6 +42,12 @@ ProxyVideoSupplier::FillBuffer(int64 startFrame, void* buffer,
status_t ret = fSupplier->SeekToFrame(&frame);
if (ret != B_OK)
return ret;
// Read frames until we reach the frame before the one we want to read.
// But don't do it for more than 5 frames, or we will take too much
// time. Doing it this way will still catch up to the next keyframe
// eventually (we may return the wrong frames until the next keyframe).
if (startFrame - frame > 5)
return B_TIMED_OUT;
while (frame < startFrame) {
ret = fSupplier->ReadFrame(buffer, &performanceTime, format,
wasCached);