summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Engel <dengel@mythtv.org>2011-09-28 15:57:27 (GMT)
committer David Engel <dengel@mythtv.org>2011-09-28 16:02:53 (GMT)
commit9f871f6357b224d150ca8e3c97303439e4a2761c (patch)
treea99ba448b7479a24b597ea0f0150b01b5f2e7dc2
parent909b444ede4dd08fe1e468b969aa9928bbc6a131 (diff)
Better handle frame rate changes during fast-forward/rewind.
If the frame rate changes while fast-forwarding or rewinding, the frame interval is set incorrectly and the skip values is not changed. This leads to very erratic behavior when such a transition is hit. Fix the problem, updating the frame interval and skip values appropriately when the frame rate changes.
-rw-r--r--mythtv/libs/libmythbase/mythversion.h2
-rw-r--r--mythtv/libs/libmythtv/mythplayer.cpp37
-rw-r--r--mythtv/libs/libmythtv/mythplayer.h1
3 files changed, 29 insertions, 11 deletions
diff --git a/mythtv/libs/libmythbase/mythversion.h b/mythtv/libs/libmythbase/mythversion.h
index 74928d7..f0cb663 100644
--- a/mythtv/libs/libmythbase/mythversion.h
+++ b/mythtv/libs/libmythbase/mythversion.h
@@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
-#define MYTH_BINARY_VERSION "0.25.20110923-1"
+#define MYTH_BINARY_VERSION "0.25.20110928-1"
/** \brief Increment this whenever the MythTV network protocol changes.
*
diff --git a/mythtv/libs/libmythtv/mythplayer.cpp b/mythtv/libs/libmythtv/mythplayer.cpp
index e2ba419..d4d6e99 100644
--- a/mythtv/libs/libmythtv/mythplayer.cpp
+++ b/mythtv/libs/libmythtv/mythplayer.cpp
@@ -820,9 +820,18 @@ void MythPlayer::SetVideoParams(int width, int height, double fps,
if (fps > 0.0f && fps < 121.0f)
{
video_frame_rate = fps;
- float temp_speed = (play_speed == 0.0f) ?
- audio.GetStretchFactor() : play_speed;
- SetFrameInterval(kScan_Progressive, 1.0 / (video_frame_rate * temp_speed));
+ if (ffrew_skip != 0 && ffrew_skip != 1)
+ {
+ UpdateFFRewSkip();
+ videosync->setFrameInterval(frame_interval);
+ }
+ else
+ {
+ float temp_speed = (play_speed == 0.0f) ?
+ audio.GetStretchFactor() : play_speed;
+ SetFrameInterval(kScan_Progressive,
+ 1.0 / (video_frame_rate * temp_speed));
+ }
}
if (videoOutput)
@@ -3207,15 +3216,12 @@ uint64_t MythPlayer::GetBookmark(void)
return bookmark;
}
-void MythPlayer::ChangeSpeed(void)
+bool MythPlayer::UpdateFFRewSkip(void)
{
- float last_speed = play_speed;
- play_speed = next_play_speed;
- normal_speed = next_normal_speed;
-
- float temp_speed = (play_speed == 0.0) ? audio.GetStretchFactor() : play_speed;
-
bool skip_changed;
+
+ float temp_speed = (play_speed == 0.0) ?
+ audio.GetStretchFactor() : play_speed;
if (play_speed >= 0.0f && play_speed <= 3.0f)
{
skip_changed = (ffrew_skip != 1);
@@ -3242,6 +3248,17 @@ void MythPlayer::ChangeSpeed(void)
ffrew_skip = play_speed < 0.0f ? -ffrew_skip : ffrew_skip;
ffrew_adjust = 0;
}
+
+ return skip_changed;
+}
+
+void MythPlayer::ChangeSpeed(void)
+{
+ float last_speed = play_speed;
+ play_speed = next_play_speed;
+ normal_speed = next_normal_speed;
+
+ bool skip_changed = UpdateFFRewSkip();
videosync->setFrameInterval(frame_interval);
if (skip_changed && videoOutput)
diff --git a/mythtv/libs/libmythtv/mythplayer.h b/mythtv/libs/libmythtv/mythplayer.h
index 051d07d..8776348 100644
--- a/mythtv/libs/libmythtv/mythplayer.h
+++ b/mythtv/libs/libmythtv/mythplayer.h
@@ -491,6 +491,7 @@ class MTV_PUBLIC MythPlayer
bool DecoderGetFrame(DecodeType, bool unsafe = false);
// These actually execute commands requested by public members
+ bool UpdateFFRewSkip(void);
virtual void ChangeSpeed(void);
bool DoFastForward(uint64_t frames, bool override_seeks = false,
bool seeks_wanted = false);