BMediaEventLooper: Return to simple lateness computation
* Remove enqueue_time again. * Lateness seems generally useless. No way to get something useful experimentally. The commit noise however was useful, the port wait is behaving more in accordance with the lateness calculus. * Fixes #12817 and possibly #12594.
This commit is contained in:
@@ -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];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -78,9 +78,6 @@ _event_queue_imp::AddEvent(const media_timed_event &event)
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
const_cast<media_timed_event&>(event).enqueue_time
|
||||
= BTimeSource::RealTime();
|
||||
|
||||
//create a new queue
|
||||
if (fFirstEntry == NULL) {
|
||||
ASSERT(fEventCount == 0);
|
||||
|
||||
Reference in New Issue
Block a user