[dasher] Encourage bitrate change to have near immediate effect.
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher] Encourage bitrate change to have near immediate effect.
- Date: Tue, 12 Oct 2010 11:34:32 +0000 (UTC)
commit c5930b96233e2fd891892205c66745e0c31f934e
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date: Tue Oct 12 09:26:09 2010 +0100
Encourage bitrate change to have near immediate effect.
When you increase the framerate, the new value of iSteps (which has to
be much smaller, i.e. perform the expansion to the cursor over iSteps
frames) is interpolated with the previous value, so it takes several
updates to get to where it needs to be. This patch recomputes iSteps
on receipt of the speed change event(s).
Src/DasherCore/FrameRate.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/Src/DasherCore/FrameRate.cpp b/Src/DasherCore/FrameRate.cpp
index 742b9af..2712d02 100644
--- a/Src/DasherCore/FrameRate.cpp
+++ b/Src/DasherCore/FrameRate.cpp
@@ -70,6 +70,8 @@ void CFrameRate::HandleEvent(Dasher::CEvent *pEvent) {
case LP_MAX_BITRATE: // Delibarate fallthrough
case LP_BOOSTFACTOR:
BitrateChanged(GetLongParameter(LP_MAX_BITRATE) * GetLongParameter(LP_BOOSTFACTOR) / 10000.0);
+ //Apply the bit rate fully straightaway (no 50:50 interpolation with previous):
+ m_iSteps = (int)(-log(0.2) * m_dFr / LN2 / m_dMaxbitrate);
break;
case LP_FRAMERATE:
FramerateChanged(GetLongParameter(LP_FRAMERATE) / 100.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]