Subject: pkg/32268: pkg audio/faad2 bugfix for stdout
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <parag@codegen.com>
List: pkgsrc-bugs
Date: 12/08/2005 04:45:00
>Number:         32268
>Category:       pkg
>Synopsis:       supurious newline char on stdout from faad screws up audio
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 08 04:45:00 +0000 2005
>Originator:     Parag Patel
>Release:        NetBSD 2.1.0_STABLE
>Organization:
CodeGen, Inc.
>Environment:
System: NetBSD hammer.parag.codegen.com 2.1.0_STABLE NetBSD 2.1.0_STABLE (HAMMER) #0: Sun Nov 20 14:42:52 PST 2005 parag@hammerhead.parag.codegen.com:/usr/src/sys/arch/amd64/compile/HAMMER amd64
Architecture: x86_64
Machine: amd64
>Description:
	faad (pkgsrc/audio/faad2) can generate a bogus newline character on
	stdout if there are ID tags in an AAC (M4A) file.  This can mess up
	audio if that is also redirected to stdout, as it is by slimserver
	(for instance) before sending to a Squeezbox.

>How-To-Repeat:
	run "faad -w infile.m4a > out.wav" and "faad infile.m4a", then compare
	the generated files infile.wav and out.wav.

>Fix:
	The attached patch to main.c puts the newline character on stderr,
	where it should have been all along.

--- frontend/main.c.orig	2005-12-07 20:34:20.000000000 -0800
+++ frontend/main.c	2005-12-07 20:34:28.000000000 -0800
@@ -832,7 +832,7 @@
                 }
             }
         }
-        if (j > 0) printf("\n");
+        if (j > 0) fprintf(stderr, "\n");
 #endif
     }