From owner-freebsd-multimedia Thu Dec 24 02:59:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA16692 for freebsd-multimedia-outgoing; Thu, 24 Dec 1998 02:59:27 -0800 (PST) (envelope-from owner-freebsd-multimedia@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id CAA16684; Thu, 24 Dec 1998 02:59:10 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id JAA04897; Thu, 24 Dec 1998 09:48:02 +0100 From: Luigi Rizzo Message-Id: <199812240848.JAA04897@labinfo.iet.unipi.it> Subject: Re: cvs commit: ports/audio/mp3encode - Imported sources To: steve@FreeBSD.ORG (Steve Price) Date: Thu, 24 Dec 1998 09:48:02 +0100 (MET) Cc: multimedia@FreeBSD.ORG In-Reply-To: <199812240659.WAA08724@freefall.freebsd.org> from "Steve Price" at Dec 23, 98 10:59:25 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org [forwarded to -multimedia] > steve 1998/12/23 22:59:44 PST > > ports/audio/mp3encode - Imported sources > Update of /home/ncvs/ports/audio/mp3encode > In directory freefall.freebsd.org:/d/users/steve/work/mp3encode > > Log Message: > Initial import of mp3encode version 1.10. > An MPEG layer I, II, and III audio file encoder. this code has at least two problems. The first one is that "ISO" (not sure these ones actually come from ISO..) sources historically have had their own ideas about endiannes, and on i386 they end up swapping samples in the wrong way. A quick fix for the encoder is below, and suffices to encode audio tracks coming from CDs. I am not sure at all this is the only place with endiannes problem. The second problem is introduced by the patch which changes gets() into fgets() not accounting for the final \n returned by fgets, which ends up being part of the filename. Of course if someone is going to look at this package, a look at performance would not be a bad thing. E.g. just common I/O routines (putbits and friend) could be made way faster, and i also suspect that some pieces of core code would benefit from a programmer's look cheers luigi prova# pwd /usr/ports/audio/mp3encode/work/dist10/lsf/encoder prova# diff -ubwr encode.c.orig encode.c --- encode.c.orig Wed Jan 22 10:43:14 1997 +++ encode.c Thu Dec 24 11:33:52 1998 @@ -153,9 +153,10 @@ exit( 1 ); } } +#if 0 /* XXX lr */ if ( NativeByteOrder == order_littleEndian ) SwapBytesInWords( sample_buffer, samples_read ); - +#endif samples_to_read -= samples_read; if (samples_read < frame_size && samples_read > 0) { printf("Insufficient PCM input for one frame - fillout with zeros\n"); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message