Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2]: src/usr.bin/audio/play Pull up revision 1.45 (requested by mr...



details:   https://anonhg.NetBSD.org/src/rev/5d95edfb944b
branches:  netbsd-2
changeset: 563810:5d95edfb944b
user:      riz <riz%NetBSD.org@localhost>
date:      Mon Jul 18 04:11:03 2005 +0000

description:
Pull up revision 1.45 (requested by mrg in ticket #5498):
play.c: allow empty files to exit gracefully rather than with an error
of "header seems really large".  reported by wiz.

record.c: don't use total_size in the header if is -1 (it's initial valu
e)

diffstat:

 usr.bin/audio/play/play.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (41 lines):

diff -r a30ddfa4d704 -r 5d95edfb944b usr.bin/audio/play/play.c
--- a/usr.bin/audio/play/play.c Mon Jul 18 04:11:00 2005 +0000
+++ b/usr.bin/audio/play/play.c Mon Jul 18 04:11:03 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: play.c,v 1.42 2003/06/23 12:15:03 agc Exp $    */
+/*     $NetBSD: play.c,v 1.42.4.1 2005/07/18 04:11:03 riz Exp $        */
 
 /*
  * Copyright (c) 1999 Matthew R. Green
@@ -30,7 +30,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: play.c,v 1.42 2003/06/23 12:15:03 agc Exp $");
+__RCSID("$NetBSD: play.c,v 1.42.4.1 2005/07/18 04:11:03 riz Exp $");
 #endif
 
 
@@ -331,8 +331,8 @@
                        errx(1, "unknown audio file: %s", file);
        }
        if (hdrlen > 0) {
-               if (hdrlen >= nr)       /* shouldn't happen */
-                       errx(1, "header seems really large");
+               if (hdrlen > nr)        /* shouldn't happen */
+                       errx(1, "header seems really large: %lld", (long long)hdrlen);
                memmove(buffer, buffer + hdrlen, nr - hdrlen);
                nr -= hdrlen;
        }
@@ -444,9 +444,11 @@
                const char *enc = audio_enc_from_val(info.play.encoding);
 
                printf("%s: sample_rate=%d channels=%d "
+                  "datasize=%lld "
                   "precision=%d%s%s\n", file,
                   info.play.sample_rate,
                   info.play.channels,
+                  (long long)*datasize,
                   info.play.precision,
                   enc ? " encoding=" : "", 
                   enc ? enc : "");



Home | Main Index | Thread Index | Old Index