diff options
author | sbruno <sbruno@FreeBSD.org> | 2009-02-02 21:05:12 +0000 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2009-02-02 21:05:12 +0000 |
commit | d140e8a9d2fea221bb0f4c12a6b639a92e2731e9 (patch) | |
tree | ba15663fef53743f0318184d97de17194c0f2afe /usr.sbin | |
parent | a01bfe224224bef58bfc2120a3209d82c2596a2c (diff) | |
download | FreeBSD-src-d140e8a9d2fea221bb0f4c12a6b639a92e2731e9.zip FreeBSD-src-d140e8a9d2fea221bb0f4c12a6b639a92e2731e9.tar.gz |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/fwcontrol/fwdv.c | 18 | ||||
-rw-r--r-- | usr.sbin/fwcontrol/fwmpegts.c | 7 |
2 files changed, 12 insertions, 13 deletions
diff --git a/usr.sbin/fwcontrol/fwdv.c b/usr.sbin/fwcontrol/fwdv.c index 7b749e6..23237e5 100644 --- a/usr.sbin/fwcontrol/fwdv.c +++ b/usr.sbin/fwcontrol/fwdv.c @@ -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"); } diff --git a/usr.sbin/fwcontrol/fwmpegts.c b/usr.sbin/fwcontrol/fwmpegts.c index d485819..e92b799 100644 --- a/usr.sbin/fwcontrol/fwmpegts.c +++ b/usr.sbin/fwcontrol/fwmpegts.c @@ -195,10 +195,9 @@ mpegtsrecv(int d, const char *filename, char ich, int count) 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; |