Date: Fri, 02 Jan 2009 23:26:30 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: firewire@freebsd.org Subject: fwcontrol patches Message-ID: <20090102.232630.1387162816.imp@bsdimp.com>
next in thread | raw e-mail | index | archive | help
Here's some minor patches to fwcontrol so that the DV capture mode is
"nicer". I'd like to make the EAGAIN handling better, as well as
offer automated rewind + play + error recoverty for at least my
camera. The first step in that is to have it print an elapsed time
instead of the single digit per frame.
The second chunk is just removing dead code.
Comments?
Warner
Index: fwdv.c
===================================================================
--- fwdv.c (revision 186639)
+++ fwdv.c (working copy)
@@ -202,7 +202,9 @@
(dv->payload[0] & DV_DSF_12) == 0)
dv->payload[0] |= DV_DSF_12;
nb = nblocks[system];
- fprintf(stderr, "%d", k%10);
+ fprintf(stderr, "%d:%02d:%02d %2d\r",
+ k / (1800 * 60), (k / 1800) % 60,
+ (k / 30) % 60, k % 30);
#if FIX_FRAME
if (m > 0 && m != nb) {
/* padding bad frame */
@@ -221,10 +223,6 @@
}
#endif
k++;
- if (k % frame_rate[system] == 0) {
- /* every second */
- fprintf(stderr, "\n");
- }
fflush(stderr);
m = 0;
}
Index: fwmpegts.c
===================================================================
--- fwmpegts.c (revision 186639)
+++ fwmpegts.c (working copy)
@@ -195,10 +195,9 @@
if (len < 0) {
if (errno == EAGAIN) {
fprintf(stderr, "(EAGAIN) - push 'Play'?\n");
- if (len <= 0)
- continue;
- } else
- err(1, "read failed");
+ continue;
+ }
+ err(1, "read failed");
}
ptr = (uint32_t *) buf;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090102.232630.1387162816.imp>
