Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2002 22:41:03 +0100 (CET)
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/35009: audio/mpg123 port contains bogus patch
Message-ID:  <20020216214103.AF47355FE@des.thinksec.com>

next in thread | raw e-mail | index | archive | help

>Number:         35009
>Category:       ports
>Synopsis:       audio/mpg123 port contains bogus patch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 16 13:50:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Dag-Erling Smorgrav
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD des.thinksec.com 5.0-CURRENT FreeBSD 5.0-CURRENT #129: Fri Feb 15 16:45:40 CET 2002 des@des.thinksec.com:/usr/src/sys/i386/compile/DES i386

>Description:

ports/audio/mpg123/files/patch-audio.c is bogus: get_capabilities() is only
called if the verbose level is 2 or higher.  If you try to enable buffering
without setting a high verbose level, you get the following:

% mpg123 -b 512 **/*3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!

Directory: Volume 2/CD 1/
Playing MPEG stream from track01.mp3 ...
MPEG 1.0 layer III, 112 kbit/s, 44100 Hz joint-stereo
No supported rate found!
Yuck! Error in buffer handling...: Undefined error: 0

Moreover, with the patch applied, get_capabilities() is called once for each
possible combination of channel number, rate and encoding, which for an
average sound card is something like 120 combinations; however,
get_capabilities() already iterates over all those combinations, calling
audio_get_formats() once for each, this results in 14400 calls to 
audio_get_formats(), which is 14280 too many - and audio_get_formats() is I/O-
intensive, so the patch slows mpg123 down to a crawl at startup.

The original code loops over all channel/rate/encoding combinations exactly
once, before checking the verbosity level.

BTW, the kernel bug that ports/audio/mpg123/files/patch-ad tries to work
around was fixed at least half a year ago.

>How-To-Repeat:

See above.

>Fix:

Nuke ports/audio/mpg123/files/patch-audio.c.

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020216214103.AF47355FE>