From owner-freebsd-firewire@FreeBSD.ORG Mon Feb 2 17:27:23 2009 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C04981065689 for ; Mon, 2 Feb 2009 17:27:23 +0000 (UTC) (envelope-from sean.bruno@dsl-only.net) Received: from iron2.pdx.net (iron2.pdx.net [69.64.224.71]) by mx1.freebsd.org (Postfix) with ESMTP id 9A6C08FC20 for ; Mon, 2 Feb 2009 17:27:23 +0000 (UTC) (envelope-from sean.bruno@dsl-only.net) Received: (qmail 1450 invoked from network); 2 Feb 2009 09:27:22 -0800 Received: from 069-064-235-060.pdx.net (HELO ?192.168.1.51?) (69.64.235.60) by iron2.pdx.net with SMTP; 2 Feb 2009 09:27:21 -0800 From: Sean Bruno To: "M. Warner Losh" Content-Type: multipart/mixed; boundary="=-f/E+mOYyEYJIfL9Cml1b" Date: Mon, 02 Feb 2009 09:27:18 -0800 Message-Id: <1233595638.8067.1.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 (2.24.3-1.fc10) Cc: freebsd-firewire Subject: fwcontrol patch X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 17:27:24 -0000 --=-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--