Your message dated Tue, 01 Jul 2008 02:47:03 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#457488: fixed in ttyrec 1.0.8-3
has caused the Debian Bug report #457488,
regarding ttyplay: pause button
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
457488: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457488
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: ttyrec
Version: 1.0.6-1
Severity: wishlist
Tags: patch

I would find a pause button useful in ttyplay. One can sort of simulate
it by pressing '-' a number of times, but (a) that's inconvenient and
(b) it doesn't allow for immediately pausing playback at the current
point because the playback advances each time you press '-'.

A patch implementing this is attached. I considered the space bar as the
pause button by analogy with popular media players, but noted that I
have a habit of pressing space to advance so thought that other people
might have the same habit and be annoyed to have it broken. Instead I
chose '0', to match the existing '1' binding to set the speed to 1.0.

A naïve implementation simply sets the speed to 0.0 when you press '0',
and arranges for a speed of 0.0 to translate to passing NULL as the
select timeout. This is OK, but it still means that pressing '0'
advances the recording by one position and then pauses. I use ttyplay to
play back recordings of NetHack games, and in that context I often want
to pause immediately, for example just as the player's inventory is
displayed. I thus also adjusted the ttyplay function to repeatedly call
wait_func until speed is non-zero (and ttywrite to return 1.0 rather
than 0.0), which fixes this.

Thanks,

-- 
Colin Watson                                       [EMAIL PROTECTED]
--- ttyrec-1.0.6.orig/ttyplay.c
+++ ttyrec-1.0.6/ttyplay.c
@@ -81,13 +81,16 @@
 ttywait (struct timeval prev, struct timeval cur, double speed)
 {
     struct timeval diff = timeval_diff(prev, cur);
+    struct timeval *diffp = &diff;
     fd_set readfs;
 
-    assert(speed != 0);
-    diff = timeval_div(diff, speed);
+    if (speed == 0)
+        diffp = NULL;
+    else
+        diff = timeval_div(diff, speed);
 
     FD_SET(STDIN_FILENO, &readfs);
-    select(1, &readfs, NULL, NULL, &diff); /* skip if a user hits any key */
+    select(1, &readfs, NULL, NULL, diffp); /* skip if a user hits any key */
     if (FD_ISSET(0, &readfs)) { /* a user hits a character? */
         char c;
         read(STDIN_FILENO, &c, 1); /* drain the character */
@@ -103,6 +106,9 @@
         case '1':
             speed = 1.0;
             break;
+        case '0':
+            speed = 0.0;
+            break;
         }
     }
     return speed;
@@ -112,7 +118,7 @@
 ttynowait (struct timeval prev, struct timeval cur, double speed)
 {
     /* do nothing */
-    return 0; /* Speed isn't important. */
+    return 1.0; /* Speed isn't important. */
 }
 
 int
@@ -178,7 +184,9 @@
 	}
 
 	if (!first_time) {
-	    speed = wait_func(prev, h.tv, speed);
+	    do {
+		speed = wait_func(prev, h.tv, speed);
+	    } while (speed == 0.0);
 	}
 	first_time = 0;
 

--- End Message ---
--- Begin Message ---
Source: ttyrec
Source-Version: 1.0.8-3

We believe that the bug you reported is fixed in the latest version of
ttyrec, which is due to be installed in the Debian FTP archive:

ttyrec_1.0.8-3.diff.gz
  to pool/main/t/ttyrec/ttyrec_1.0.8-3.diff.gz
ttyrec_1.0.8-3.dsc
  to pool/main/t/ttyrec/ttyrec_1.0.8-3.dsc
ttyrec_1.0.8-3_i386.deb
  to pool/main/t/ttyrec/ttyrec_1.0.8-3_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
NIIBE Yutaka <[EMAIL PROTECTED]> (supplier of updated ttyrec package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 01 Jul 2008 11:29:27 +0900
Source: ttyrec
Binary: ttyrec
Architecture: source i386
Version: 1.0.8-3
Distribution: unstable
Urgency: low
Maintainer: NIIBE Yutaka <[EMAIL PROTECTED]>
Changed-By: NIIBE Yutaka <[EMAIL PROTECTED]>
Description: 
 ttyrec     - Terminal interaction recorder and player (for tty)
Closes: 457488
Changes: 
 ttyrec (1.0.8-3) unstable; urgency=low
 .
   * Apply a patch by Colin Watson (Closes: #457488).
     * ttyplay.c (ttywait): Implement a case where speed == 0.0.
     * ttyplay.c (ttynowait): Return 1.0 (was: 0).
     * ttyplay.c (ttyplay): Loop until speed != 0.0.
   * debian/control (Standards-Version): Conform to 3.8.0.
Checksums-Sha1: 
 3188b762d8b900a73b23866a4b427003c6369ccb 938 ttyrec_1.0.8-3.dsc
 30c23a8aa98985be17fe475cc3cc2d58c99af584 37026 ttyrec_1.0.8-3.diff.gz
 00b4b1429f622247720a0d1ac353fc1867e4daf4 33594 ttyrec_1.0.8-3_i386.deb
Checksums-Sha256: 
 87d729499afa558940489d1547b9a58a2807894b1cccb312f01beeba39b949d5 938 
ttyrec_1.0.8-3.dsc
 7b95329c93a04fadd020f8ff8881b633b548ee0b9dc1b42edc6131cb3f1fc397 37026 
ttyrec_1.0.8-3.diff.gz
 edbf1bb39812332a527d68239a3be739ded7e87da35925528afa03349b935055 33594 
ttyrec_1.0.8-3_i386.deb
Files: 
 db00dc4be09fb1dd5a032052c4502b4c 938 misc optional ttyrec_1.0.8-3.dsc
 9c30ab4dd992a85a9857908bf272c9c8 37026 misc optional ttyrec_1.0.8-3.diff.gz
 041b086462df6d512c304bce9412552a 33594 misc optional ttyrec_1.0.8-3_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkhpmPsACgkQBB45r3HV9DqGowCfRE2gFCtlt+fXhRGg56vbrGQ3
OX0AnjXljbtaBhnqJ8zX/B21EcWySTnx
=2934
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to