diff --git a/headers/os/media/TimedEventQueue.h b/headers/os/media/TimedEventQueue.h index ce00b5b6ed..732fd1727b 100644 --- a/headers/os/media/TimedEventQueue.h +++ b/headers/os/media/TimedEventQueue.h @@ -38,9 +38,8 @@ struct media_timed_event { int32 data; int64 bigdata; char user_data[64]; - bigtime_t enqueue_time; - uint32 _reserved_media_timed_event_[6]; + uint32 _reserved_media_timed_event_[8]; }; diff --git a/src/kits/media/MediaEventLooper.cpp b/src/kits/media/MediaEventLooper.cpp index dd4ae0fbfc..2c78e5848f 100644 --- a/src/kits/media/MediaEventLooper.cpp +++ b/src/kits/media/MediaEventLooper.cpp @@ -239,19 +239,13 @@ BMediaEventLooper::ControlLoop() if (err == B_OK) { // The general idea of lateness is to allow // the client code to detect when the buffer - // is handled late or early. What we add is - // that the code log the time at which the - // current event is added to the queue. This - // allow us to detect cyclic/stagnant latency - // in the meantime, so that the client can - // notify to the producer only the portion - // that might be attributable. - bigtime_t lateness = waitUntil - TimeSource()->RealTime(); - if (lateness < 0 && event.enqueue_time > waitUntil) { - lateness = event.enqueue_time - - TimeSource()->RealTime(); - } - DispatchEvent(&event, -lateness, hasRealtime); + // is handled late or early. + bigtime_t lateness = TimeSource()->RealTime() - waitUntil; + // Maximum amount of lateness we tolerate + if (lateness < 3000L) + lateness = 0; + + DispatchEvent(&event, lateness, hasRealtime); } } else if (err != B_OK) return; diff --git a/src/kits/media/TimedEventQueuePrivate.cpp b/src/kits/media/TimedEventQueuePrivate.cpp index aac6111bb9..0436d98c50 100644 --- a/src/kits/media/TimedEventQueuePrivate.cpp +++ b/src/kits/media/TimedEventQueuePrivate.cpp @@ -78,9 +78,6 @@ _event_queue_imp::AddEvent(const media_timed_event &event) return B_BAD_VALUE; } - const_cast(event).enqueue_time - = BTimeSource::RealTime(); - //create a new queue if (fFirstEntry == NULL) { ASSERT(fEventCount == 0);