From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 1 08:10:11 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A98DA1065672 for ; Sun, 1 May 2011 08:10:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 985AF8FC0A for ; Sun, 1 May 2011 08:10:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p418AB3n055683 for ; Sun, 1 May 2011 08:10:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p418ABiq055682; Sun, 1 May 2011 08:10:11 GMT (envelope-from gnats) Date: Sun, 1 May 2011 08:10:11 GMT Message-Id: <201105010810.p418ABiq055682@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Zhihao Yuan Cc: Subject: Re: ports/156747: multimedia/mplayer: fix 24-bits OSS + some improvements X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Zhihao Yuan List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 08:10:11 -0000 The following reply was made to PR ports/156747; it has been noted by GNATS. From: Zhihao Yuan To: Pan Tsu Cc: bug-followup@freebsd.org Subject: Re: ports/156747: multimedia/mplayer: fix 24-bits OSS + some improvements Date: Sun, 1 May 2011 03:07:27 -0500 On Sun, May 1, 2011 at 2:32 AM, Pan Tsu wrote: > Zhihao Yuan writes: > >> =C2=A0 =C2=A0 =C2=A0 mplayer does not detects 24-bits OSS correctly. It = only >> detects AFMT_S24_PACKED, which is not available for the OSS on >> FreeBSD. > [...] >> +@@ -72,6 +72,10 @@ static int format2oss(int format) >> + =C2=A0 =C2=A0 case AF_FORMAT_S16_BE: return AFMT_S16_BE; >> + #ifdef AFMT_S24_PACKED >> + =C2=A0 =C2=A0 case AF_FORMAT_S24_LE: return AFMT_S24_PACKED; > >> ++#elif defined(AFMT_S24_LE) && defined(__FreeBSD__) >> ++ =C2=A0 =C2=A0case AF_FORMAT_S24_LE: return AFMT_S24_LE; >> ++#elif defined(AFMT_S24_BE) && defined(__FreeBSD__) >> ++ =C2=A0 =C2=A0case AF_FORMAT_S24_BE: return AFMT_S24_BE; > > Only signed 24bit formats? They do not seem to be specific to our OSS > implementation. > > =C2=A0$ cd audio/oss; make extract > =C2=A0$ fgrep -lr AFMT_S24_LE $(make -V WRKDIR) > =C2=A0[...] > =C2=A0WRKDIR/oss-v4.2-build2004-src-bsd/include/soundcard.h > > Not so for unsigned (*_U24_*) which are supported by libaf, too. > But they're similar to AFMT_U32_(LE|BE) that are used by ao_oss > *without* __FreeBSD__ ifdef around them. > > And because AFMT_S24_(LE|BE) are defined unconditionally on both little- > and big-endian systems only the first match would be compiled in, > i.e. only AFMT_S24_LE. How about below patch? > >> + #endif >> + #ifdef AFMT_U32_LE >> + =C2=A0 =C2=A0 case AF_FORMAT_U32_LE: return AFMT_U32_LE; >> +@@ -115,6 +119,10 @@ static int oss2format(int format) >> + =C2=A0 =C2=A0 case AFMT_S16_BE: return AF_FORMAT_S16_BE; >> + #ifdef AFMT_S24_PACKED >> + =C2=A0 =C2=A0 case AFMT_S24_PACKED: return AF_FORMAT_S24_LE; >> ++#elif defined(AFMT_S24_LE) && defined(__FreeBSD__) >> ++ =C2=A0 =C2=A0case AFMT_S24_LE: return AF_FORMAT_S24_LE; >> ++#elif defined(AFMT_S24_BE) && defined(__FreeBSD__) >> ++ =C2=A0 =C2=A0case AFMT_S24_BE: return AF_FORMAT_S24_BE; >> + #endif >> + #ifdef AFMT_U32_LE >> + =C2=A0 =C2=A0 case AFMT_U32_LE: return AF_FORMAT_U32_LE; >> +@@ -448,6 +456,7 @@ static void reset(void){ > > --- a.diff begins here --- > Index: multimedia/mplayer/files/patch-libao2-ao_oss.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /a/.cvsup/ports/multimedia/mplayer/files/patch-libao2-ao_oss.c,= v > retrieving revision 1.4 > diff -u -p -r1.4 patch-libao2-ao_oss.c > --- multimedia/mplayer/files/patch-libao2-ao_oss.c =C2=A0 =C2=A0 =C2=A021= Apr 2010 13:07:22 -0000 =C2=A0 =C2=A0 =C2=A01.4 > +++ multimedia/mplayer/files/patch-libao2-ao_oss.c =C2=A0 =C2=A0 =C2=A01 = May 2011 07:26:38 -0000 > @@ -1,5 +1,43 @@ > =C2=A0--- libao2/ao_oss.c.orig =C2=A0 =C2=A0 =C2=A0 2009-05-12 21:58:57.0= 00000000 -0500 > =C2=A0+++ libao2/ao_oss.c =C2=A0 =C2=A02009-07-23 19:58:44.870097203 -050= 0 > +@@ -72,6 +72,18 @@ static int format2oss(int format) > + #ifdef AFMT_S24_PACKED > + =C2=A0 =C2=A0 case AF_FORMAT_S24_LE: return AFMT_S24_PACKED; > + #endif > ++#ifdef AFMT_U24_LE > ++ =C2=A0 =C2=A0case AF_FORMAT_U24_LE: return AFMT_U24_LE; > ++#endif > ++#ifdef AFMT_U24_BE > ++ =C2=A0 =C2=A0case AF_FORMAT_U24_BE: return AFMT_U24_BE; > ++#endif > ++#ifdef AFMT_S24_LE > ++ =C2=A0 =C2=A0case AF_FORMAT_S24_LE: return AFMT_S24_LE; > ++#endif > ++#ifdef AFMT_S24_BE > ++ =C2=A0 =C2=A0case AF_FORMAT_S24_BE: return AFMT_S24_BE; > ++#endif > + #ifdef AFMT_U32_LE > + =C2=A0 =C2=A0 case AF_FORMAT_U32_LE: return AFMT_U32_LE; > + #endif > +@@ -115,6 +127,18 @@ static int oss2format(int format) > + #ifdef AFMT_S24_PACKED > + =C2=A0 =C2=A0 case AFMT_S24_PACKED: return AF_FORMAT_S24_LE; > + #endif > ++#ifdef AFMT_U24_LE > ++ =C2=A0 =C2=A0case AFMT_U24_LE: return AF_FORMAT_U24_LE; > ++#endif > ++#ifdef AFMT_U24_BE > ++ =C2=A0 =C2=A0case AFMT_U24_BE: return AF_FORMAT_U24_BE; > ++#endif > ++#ifdef AFMT_S24_LE > ++ =C2=A0 =C2=A0case AFMT_S24_LE: return AF_FORMAT_S24_LE; > ++#endif > ++#ifdef AFMT_S24_BE > ++ =C2=A0 =C2=A0case AFMT_S24_BE: return AF_FORMAT_S24_BE; > ++#endif > + #ifdef AFMT_U32_LE > + =C2=A0 =C2=A0 case AFMT_U32_LE: return AF_FORMAT_U32_LE; > + #endif > =C2=A0@@ -453,6 +453,7 @@ > =C2=A0 =C2=A0fcntl(audio_fd, F_SETFD, FD_CLOEXEC); > =C2=A0#endif > --- a.diff ends here --- > I checked the 'official' oss header file (on linux/netbsd), and AFMT_*24_* exist in both FreeBSD and OSS 4.x. I agree with the new patch. --=20 Zhihao Yuan The best way to predict the future is to invent it.