From b8b74f90f4e3920f5379d532189a4182b698ea55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 6 Sep 2010 18:13:58 +0000 Subject: [PATCH] Resolved TODO. The current time should point to the beginning of the next buffer. GetNextChunk() still has the same problem. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38544 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/MediaTrack.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kits/media/MediaTrack.cpp b/src/kits/media/MediaTrack.cpp index 00adbd5aea..5c38f93e84 100644 --- a/src/kits/media/MediaTrack.cpp +++ b/src/kits/media/MediaTrack.cpp @@ -313,12 +313,9 @@ BMediaTrack::ReadFrames(void* buffer, int64* _frameCount, result = fDecoder->Decode(buffer, _frameCount, _header, info); if (result == B_OK) { fCurrentFrame += *_frameCount; - // TODO: This changes the meaning of fCurrentTime from pointing - // to the next chunk start time (i.e. after seeking) to the start time - // of the last chunk. Asking the extractor for the current time will - // not work so well because of the chunk cache. But providing a - // "duration" field in the media_header could be useful. - fCurrentTime = fCurrentTime = _header->start_time; + bigtime_t framesDuration = (bigtime_t)(*_frameCount * 1000000 + / _FrameRate()); + fCurrentTime = _header->start_time + framesDuration; } else { ERROR("BMediaTrack::ReadFrames: decoder returned error 0x%08lx (%s)\n", result, strerror(result));