[mythtv] Trick play patch

David Engel dlengel at attbi.com
Tue Aug 19 20:28:52 EDT 2003


On Tue, Aug 19, 2003 at 01:31:15PM -0400, Isaac Richards wrote:
> > do exact seeks for single frame increments.  I just tested this and it
> > works fine.  Should exact seeks also be done for 1 second increments?
> 
> Exact seeking is rather slow, but if it's only done (while the 'exact seeks' 
> option is turned off) while paused, that's fine.

The patch for that is below.  It also fixes a compiler warning.

> > I did a cvs up right before testing this latest change.  Could one of
> > the commits done in the last couple days have affected this?
> 
> I don't think anything would have that affect..  It's not happening here, 
> though.

Hmm, that's weird.  I looked at it briefly but didn't find anything.
I guess, I'll keep looking.

> Well, I couldn't think of a nicer way to do it, so I went and committed your 
> patch =)  I'll probably add another variable sometime so it's not doing the 
> dividing by play_speed all the time later.

Great.  I'll take a look at this myself later tonight.  My intent was
to get it working right first, then worry about any optimizations.

One thing I didn't get entirely right though was the OSD.  The fade
speed is too fast or slow if the play speed isn't 1x.  Do you have any
suggestions for an acceptable fix?  It's not a high priority, but I'd
still like to fix it.

David
-- 
David Engel
dlengel at attbi.com

Index: libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp,v
retrieving revision 1.254
diff -u -r1.254 NuppelVideoPlayer.cpp
--- libs/libmythtv/NuppelVideoPlayer.cpp	19 Aug 2003 17:26:08 -0000	1.254
+++ libs/libmythtv/NuppelVideoPlayer.cpp	19 Aug 2003 22:38:04 -0000
@@ -1014,7 +1014,7 @@
             if ( delay > frame_interval / play_speed * 2)
             {
                 // cerr << "Delaying to next trigger: " << delay << endl;
-                usleep(frame_interval / play_speed);
+                usleep((int)(frame_interval / play_speed));
                 delay = 0;
                 avsync_avg = 0;
                 gettimeofday(&nexttrigger, NULL);
@@ -1729,7 +1729,10 @@
     if (desiredFrame < video_frame_rate)
         limitKeyRepeat = true;
 
+    if (paused)
+	decoder->setExactSeeks(true);
     decoder->DoRewind(desiredFrame);
+    decoder->setExactSeeks(exactseeks);
 
     ClearAfterSeek();
     return true;
@@ -1776,8 +1779,11 @@
     long long number = fftime - 1;
     long long desiredFrame = framesPlayed + number;
 
+    if (paused)
+	decoder->setExactSeeks(true);
     decoder->DoFastForward(desiredFrame);
+    decoder->setExactSeeks(exactseeks);
 
     ClearAfterSeek();
     return true;


More information about the mythtv-dev mailing list