added 1 changeset to branch 'refs/remotes/orangejua-github/media' old head: bc1fb70f5ac3cea1c3c04ba529b6f67dca2863ba new head: 210fc364b79e90481deaef01c7a0b81982243f85 overview: https://github.com/orangejua/haiku/compare/bc1fb70...210fc36 ---------------------------------------------------------------------------- 210fc36: Revert "Drop buffers when latency gets larger than buffer size." We cannot use fEventLatency to compare with buffer size, it includes the whole downstream latency. Nodes have to do the run-mode adjustment themselves, based on their internal latency. Unfortunately that is not known to BMediaEventLooper. This reverts commit bc1fb70f5ac3cea1c3c04ba529b6f67dca2863ba. [ Julian Harnath <github@xxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Commit: 210fc364b79e90481deaef01c7a0b81982243f85 Author: Julian Harnath <github@xxxxxxxxxxxx> Date: Sat Oct 19 16:25:09 2013 UTC ---------------------------------------------------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) headers/os/media/MediaEventLooper.h | 9 +-------- src/kits/media/MediaEventLooper.cpp | 28 +--------------------------- ---------------------------------------------------------------------------- diff --git a/headers/os/media/MediaEventLooper.h b/headers/os/media/MediaEventLooper.h index 087c5f5..7db76ec 100644 --- a/headers/os/media/MediaEventLooper.h +++ b/headers/os/media/MediaEventLooper.h @@ -154,15 +154,8 @@ private: virtual status_t _Reserved_BMediaEventLooper_22(int32 arg, ...); virtual status_t _Reserved_BMediaEventLooper_23(int32 arg, ...); -private: - run_mode fRequestedRunMode; - -private: - void _AdjustRunMode(); - -private: bool _reserved_bool_[4]; - uint32 _reserved_BMediaEventLooper_[11]; + uint32 _reserved_BMediaEventLooper_[12]; }; #endif // _MEDIA_EVENT_LOOPER_H diff --git a/src/kits/media/MediaEventLooper.cpp b/src/kits/media/MediaEventLooper.cpp index 97e9453..e574fe0 100644 --- a/src/kits/media/MediaEventLooper.cpp +++ b/src/kits/media/MediaEventLooper.cpp @@ -47,8 +47,7 @@ BMediaEventLooper::BMediaEventLooper(uint32 apiVersion) : fSchedulingLatency(0), fBufferDuration(0), fOfflineTime(0), - fApiVersion(apiVersion), - fRequestedRunMode(B_INCREASE_LATENCY) + fApiVersion(apiVersion) { CALLED(); fEventQueue.SetCleanupHook(BMediaEventLooper::_CleanUpEntry, this); @@ -203,8 +202,6 @@ BMediaEventLooper::SetRunMode(run_mode mode) } } - fRequestedRunMode = mode; - BMediaNode::SetRunMode(mode); } @@ -472,8 +469,6 @@ BMediaEventLooper::SetEventLatency(bigtime_t latency) latency, latency - fEventLatency); fEventLatency = latency; - - _AdjustRunMode(); } @@ -482,8 +477,6 @@ BMediaEventLooper::SetBufferDuration(bigtime_t duration) { CALLED(); fBufferDuration = duration; - - _AdjustRunMode(); } @@ -621,25 +614,6 @@ BMediaEventLooper::DeleteHook(BMediaNode* node) } -// #pragma mark - private BMediaEventLooper - - -void -BMediaEventLooper::_AdjustRunMode() -{ - if (RunMode() != B_OFFLINE && - fEventLatency + fSchedulingLatency > BufferDuration()) { - // We cannot keep up timely processing anymore. We must start dropping - // buffers to not mess up timing of downstream nodes. - BMediaNode::SetRunMode(B_DROP_DATA); - } else if (RunMode() != fRequestedRunMode) { - // We can meet the timing constraints again, go back to originally - // requested runmode. - BMediaNode::SetRunMode(fRequestedRunMode); - } -} - - // #pragma mark - FBC padding and forbidden methods