[haiku-commits] r35032 - haiku/trunk/src/kits/media

  • From: superstippi@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 12 Jan 2010 21:25:59 +0100 (CET)

Author: stippi
Date: 2010-01-12 21:25:59 +0100 (Tue, 12 Jan 2010)
New Revision: 35032
Changeset: http://dev.haiku-os.org/changeset/35032/haiku

Modified:
   haiku/trunk/src/kits/media/MediaTrack.cpp
Log:
Reverted some of my changes with regards to fCurrentTime and added respective
TODOs. For now, it is easier for applications to work around the status quo
until the TODOs are implemented.


Modified: haiku/trunk/src/kits/media/MediaTrack.cpp
===================================================================
--- haiku/trunk/src/kits/media/MediaTrack.cpp   2010-01-12 20:24:10 UTC (rev 
35031)
+++ haiku/trunk/src/kits/media/MediaTrack.cpp   2010-01-12 20:25:59 UTC (rev 
35032)
@@ -313,8 +313,12 @@
                result = fDecoder->Decode(buffer, _frameCount, _header, info);
        if (result == B_OK) {
                fCurrentFrame += *_frameCount;
-               fCurrentTime = _header->start_time
-                       + *_frameCount * 1000000LL / _FrameRate();
+               // 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;
        } else {
                ERROR("BMediaTrack::ReadFrames: decoder returned error 0x%08lx 
(%s)\n",
                        result, strerror(result));
@@ -520,13 +524,14 @@
                *_buffer = const_cast<char*>(static_cast<const char*>(buffer));
                        // TODO: Change the pointer type when we break the API.
                *_size = size;
-               // Several chunks may belong to the same frame. If the start 
time is
-               // different from the previous chunk's time, the next chunk 
will belong
-               // to the next frame.
-               if (fCurrentTime != _header->start_time) {
-                       fCurrentFrame++;
-                       fCurrentTime = _header->start_time + 1000000LL / 
_FrameRate();
-               }
+               // 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;
+               fCurrentFrame = fCurrentTime * _FrameRate() / 1000000LL;
+
        }
 
        return result;


Other related posts:

  • » [haiku-commits] r35032 - haiku/trunk/src/kits/media - superstippi