From owner-svn-src-head@FreeBSD.ORG Mon Feb 2 21:05:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C62410656CB; Mon, 2 Feb 2009 21:05:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D78D8FC0A; Mon, 2 Feb 2009 21:05:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n12L5CX6007522; Mon, 2 Feb 2009 21:05:12 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n12L5C3o007520; Mon, 2 Feb 2009 21:05:12 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <200902022105.n12L5C3o007520@svn.freebsd.org> From: Sean Bruno Date: Mon, 2 Feb 2009 21:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188029 - head/usr.sbin/fwcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 21:05:14 -0000 Author: sbruno Date: Mon Feb 2 21:05:12 2009 New Revision: 188029 URL: http://svn.freebsd.org/changeset/base/188029 Log: Begin basic improvements to fwcontrol in the area of handling video streams from cameras. This patch changes the displayed timer to a time stamp and corrects one or two mishandled errors. Submitted by: imp Modified: head/usr.sbin/fwcontrol/fwdv.c head/usr.sbin/fwcontrol/fwmpegts.c Modified: head/usr.sbin/fwcontrol/fwdv.c ============================================================================== --- head/usr.sbin/fwcontrol/fwdv.c Mon Feb 2 21:02:23 2009 (r188028) +++ head/usr.sbin/fwcontrol/fwdv.c Mon Feb 2 21:05:12 2009 (r188029) @@ -202,15 +202,20 @@ again: (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 @@ again: } #endif k++; - if (k % frame_rate[system] == 0) { - /* every second */ - fprintf(stderr, "\n"); - } fflush(stderr); m = 0; } @@ -245,9 +246,8 @@ next: if (vec > 0) writev(fd, wbuf, vec); } - if(fd != STDOUT_FILENO) { + if (fd != STDOUT_FILENO) close(fd); - } fprintf(stderr, "\n"); } Modified: head/usr.sbin/fwcontrol/fwmpegts.c ============================================================================== --- head/usr.sbin/fwcontrol/fwmpegts.c Mon Feb 2 21:02:23 2009 (r188028) +++ head/usr.sbin/fwcontrol/fwmpegts.c Mon Feb 2 21:05:12 2009 (r188029) @@ -195,10 +195,9 @@ mpegtsrecv(int d, const char *filename, 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;