Date: Mon, 02 Feb 2009 09:27:18 -0800 From: Sean Bruno <sean.bruno@dsl-only.net> To: "M. Warner Losh" <imp@bsdimp.com> Cc: freebsd-firewire <freebsd-firewire@FreeBSD.org> Subject: fwcontrol patch Message-ID: <1233595638.8067.1.camel@localhost.localdomain>
next in thread | raw e-mail | index | archive | help
--=-f/E+mOYyEYJIfL9Cml1b Content-Type: text/plain Content-Transfer-Encoding: 7bit Warner: I took your patch and slightly modified it. Specifically, I changed the key printf that you are changing into a time stamp. If this works for you, I'll comitt it today. Sean --=-f/E+mOYyEYJIfL9Cml1b Content-Disposition: attachment; filename="fwcontrol.diff" Content-Type: text/x-patch; name="fwcontrol.diff"; charset="UTF-8" Content-Transfer-Encoding: 7bit Index: fwdv.c =================================================================== --- fwdv.c (revision 187993) +++ fwdv.c (working copy) @@ -202,15 +202,20 @@ (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 %d\r", + k / (3600 * frame_rate[system]), + (k / (60 * frame_rate[system])) % 60, + (k / frame_rate[system]) % 60, + k % frame_rate[system]); + #if FIX_FRAME if (m > 0 && m != nb) { /* padding bad frame */ npad = ((nb - m) % nb); if (npad < 0) npad += nb; - fprintf(stderr, "(%d blocks padded)", - npad); + fprintf(stderr, "\n%d blocks padded\n", + npad); npad *= DSIZE; wbuf[vec].iov_base = pad; wbuf[vec++].iov_len = npad; @@ -221,10 +226,6 @@ } #endif k++; - if (k % frame_rate[system] == 0) { - /* every second */ - fprintf(stderr, "\n"); - } fflush(stderr); m = 0; } @@ -245,9 +246,8 @@ if (vec > 0) writev(fd, wbuf, vec); } - if(fd != STDOUT_FILENO) { + if (fd != STDOUT_FILENO) close(fd); - } fprintf(stderr, "\n"); } Index: fwmpegts.c =================================================================== --- fwmpegts.c (revision 187993) +++ 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; --=-f/E+mOYyEYJIfL9Cml1b--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1233595638.8067.1.camel>