From 6d0505fffc0e605e0e706ea937f95f32af8e66d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 6 Jun 2008 10:17:28 +0000 Subject: [PATCH] The seeking algo stopped decoding frames one frame too early. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25819 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/mediaplayer/supplier/ProxyVideoSupplier.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/apps/mediaplayer/supplier/ProxyVideoSupplier.cpp b/src/apps/mediaplayer/supplier/ProxyVideoSupplier.cpp index a03f9f8c61..a813f56bfe 100644 --- a/src/apps/mediaplayer/supplier/ProxyVideoSupplier.cpp +++ b/src/apps/mediaplayer/supplier/ProxyVideoSupplier.cpp @@ -33,12 +33,16 @@ ProxyVideoSupplier::FillBuffer(int64 startFrame, void* buffer, return B_NO_INIT; bigtime_t performanceTime = 0; + if (fSupplier->CurrentFrame() == startFrame + 1) { + printf("ProxyVideoSupplier::FillBuffer(%lld) - Could re-use previous " + "buffer!\n", startFrame); + } if (fSupplier->CurrentFrame() != startFrame) { int64 frame = startFrame; status_t ret = fSupplier->SeekToFrame(&frame); if (ret != B_OK) return ret; - while (frame < (startFrame - 1)) { + while (frame < startFrame) { ret = fSupplier->ReadFrame(buffer, &performanceTime, format, wasCached); if (ret != B_OK) @@ -47,7 +51,8 @@ ProxyVideoSupplier::FillBuffer(int64 startFrame, void* buffer, } } - // TODO: cache into intermediate buffer! + // TODO: cache into intermediate buffer to handle the + // currentFrame = startFrame + 1 case! return fSupplier->ReadFrame(buffer, &performanceTime, format, wasCached); }