support 24-bit audio formats

ok ratchov
This commit is contained in:
jakemsr 2010-06-30 07:59:53 +00:00
parent 3468abfe2f
commit 64c85bac4a
2 changed files with 30 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.166 2010/06/14 15:06:49 edd Exp $
# $OpenBSD: Makefile,v 1.167 2010/06/30 07:59:53 jakemsr Exp $
# May not be hard to add more.
ONLY_FOR_ARCHS= amd64 i386 powerpc sparc64 arm mips64 mips64el
@ -12,7 +12,7 @@ SUBST_VARS+= PREFIX CONFDIR
N= mplayer
DISTNAME= mplayer-export-snapshot-${V}
PKGNAME= ${N}-${V}p0
PKGNAME= ${N}-${V}p1
CATEGORIES= x11 multimedia
EXTRACT_SUFX= .tar.bz2

View File

@ -105,6 +105,30 @@ static int init(int rate, int channels, int format, int flags)
par.sig = 1;
par.le = 0;
break;
case AF_FORMAT_U24_LE:
par.bits = 24;
par.bps = 3;
par.sig = 0;
par.le = 1;
break;
case AF_FORMAT_S24_LE:
par.bits = 24;
par.bps = 3;
par.sig = 1;
par.le = 1;
break;
case AF_FORMAT_U24_BE:
par.bits = 24;
par.bps = 3;
par.sig = 0;
par.le = 0;
break;
case AF_FORMAT_S24_BE:
par.bits = 24;
par.bps = 3;
par.sig = 1;
par.le = 0;
break;
case AF_FORMAT_U32_LE:
par.bits = 32;
par.sig = 0;
@ -153,6 +177,10 @@ static int init(int rate, int channels, int format, int flags)
format = par.sig ?
(par.le ? AF_FORMAT_S16_LE : AF_FORMAT_S16_BE) :
(par.le ? AF_FORMAT_U16_LE : AF_FORMAT_U16_BE);
} else if ((par.bits == 24 || par.msb) && par.bps == 3) {
format = par.sig ?
(par.le ? AF_FORMAT_S24_LE : AF_FORMAT_S24_BE) :
(par.le ? AF_FORMAT_U24_LE : AF_FORMAT_U24_BE);
} else if ((par.bits == 32 || par.msb) && par.bps == 4) {
format = par.sig ?
(par.le ? AF_FORMAT_S32_LE : AF_FORMAT_S32_BE) :