[mythtv] [PATCH] MythTV - Jump Timestretch

Michael T. Dean mtdean at thirdcontact.com
Wed May 18 05:06:16 UTC 2005


Ever since MythTV first got support for timestretch, I've been watching 
my TV at faster than real time.  At first, I started out at 1.2X, and 
once I got used to it, I sped it up a bit.  Before long, I got to the 
point that I always watch my recordings at 1.5X or faster (up to 1.9X 
for the really slow shows, but averaging about 1.75X).  Since the menu 
only goes to 1.5X (and requires a lot of key presses) and since the 
adjust timestretch uses increments of 0.05X for the LEFT/RIGHT keys 
(which means a lot of key presses), I wanted a faster way to get to the 
desired setting.

The attached patch adds support for incrementing/decrementing 
timestretch by 5 units (i.e. 0.25x) using the UP/DOWN keys, 
respectively, while in the adjust timestretch mode.  Before the patch, 
the UP/DOWN keys caused MythTV to exit adjust timestretch mode and jump 
backward/forward in the video.  After the patch, it's possible to set 
1.5X playback with only 3 keystrokes (A, UP, UP)--the same number of 
keystrokes required to get to the timestretch menu (and one less than 
the number required to display the timestretch menu).  Once the user 
exits the adjust timestretch mode, UP/DOWN continue to work as always.

The patch does not change the behavior of the ChangeTimeStretch( ) 
function.  If the request attempts to increase the speed to a value > 
2.0 or decrease to a value < 0.48, it is ignored.  Therefore, if the 
user is at 1.80X and hits UP, nothing happens.  Instead, to increase 
above 1.80X, he/she must use the RIGHT key to adjust in increments of 
0.05X (or LEFT, UP to get to 2.0X).

I chose a value of +/-5 for the increment/decrement "direction."  If 
desired, the value could be changed to +/-4 or, possibly even, 
+/-3--although, IMHO, 5 seems to work very well for "course-grained" 
adjustments.  Since the range of values which make sense for the "jump" 
is very small (i.e. no less than 3 and no more than 5), I felt that 
adding a setup option was not worthwhile (which should make those who 
feel setup already has too many options very happy).

Thanks,
Mike

P.S.  Big thanks to Dr. Mark Spieth for the timestretch patch.  Without 
it, I'd have so much TV left to watch that I would never get a chance to 
hack on MythTV.  :)
-------------- next part --------------
Index: libs/libmythtv/tv_play.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_play.cpp,v
retrieving revision 1.267
diff -u -r1.267 tv_play.cpp
--- libs/libmythtv/tv_play.cpp	14 May 2005 16:20:45 -0000	1.267
+++ libs/libmythtv/tv_play.cpp	18 May 2005 01:04:19 -0000
@@ -1625,6 +1625,10 @@
                 ChangeTimeStretch(-1);
             else if (action == "RIGHT")
                 ChangeTimeStretch(1);
+            else if (action == "DOWN")
+                ChangeTimeStretch(-5);
+            else if (action == "UP")
+                ChangeTimeStretch(5);
             else if (action == "TOGGLESTRETCH")
                 ClearOSD();
             else


More information about the mythtv-dev mailing list