From owner-freebsd-ports Fri Nov 5 1:25:45 1999 Delivered-To: freebsd-ports@freebsd.org Received: from relay1.bcs.zp.ua (bcs-zyx-eth.marka.net.ua [195.248.171.202]) by hub.freebsd.org (Postfix) with ESMTP id C2327158BA for ; Fri, 5 Nov 1999 01:25:18 -0800 (PST) (envelope-from serg@bcs3.bcs.zp.ua) Received: from bcs3.bcs.zp.ua (bcs3.bcs.zp.ua [212.8.35.73]) by relay1.bcs.zp.ua (8.9.3/8.9.3) with ESMTP id LAA13578 for ; Fri, 5 Nov 1999 11:25:12 +0200 (EET) Received: (from serg@localhost) by bcs3.bcs.zp.ua (8.9.3/8.9.3) id LAA39130 for ports@freebsd.org; Fri, 5 Nov 1999 11:25:12 +0200 (EET) (envelope-from serg) From: Sergey Shkonda Message-Id: <199911050925.LAA39130@bcs3.bcs.zp.ua> Subject: patch for audio/gogo To: ports@freebsd.org Date: Fri, 5 Nov 1999 11:25:12 +0200 (EET) X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I don't like to use sox before compressing audio from CD's The following patch allows gogo to compress raw audio data .cdr, .cda, .raw files treated as 16 bit stereo 44100 Hz audio without header. -- Sergey Shkonda --- musenc.c.orig Fri Oct 22 05:15:10 1999 +++ musenc.c Thu Nov 4 17:20:09 1999 @@ -597,6 +597,9 @@ MPGE_detectConfigure() { int freq, size, bit, channel; +#ifdef __unix__ + int plaindata = 0; +#endif if( musicin != NULL ) @@ -607,6 +610,21 @@ musicin = stdin; totalframes = -1; } else { + /* check input file extensions */ +#ifdef __unix__ + int l; + l = strlen(szInFile); + if (l > 4) + if ( !strcasecmp(szInFile+l-4, ".cda") || + !strcasecmp(szInFile+l-4, ".cdr") || + !strcasecmp(szInFile+l-4, ".raw") ) + { + bit = 16; + freq = 44100; + channel = 2; + plaindata = 1; + } +#endif musicin = fopen( szInFile, "rb" ); if( !musicin ) return ME_INFILE_NOFOUND; @@ -625,6 +642,9 @@ } nEncodeFreq = nInputFreq; }else +#endif +#ifdef __unix__ + if (!plaindata) #endif if( !WAV_checkFMT( musicin, &size, &bit, &freq, &channel) ){ fclose( musicin ); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message