summaryrefslogtreecommitdiffstats
path: root/audio/mpg123
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-02-18 09:34:12 +0000
committerdes <des@FreeBSD.org>2002-02-18 09:34:12 +0000
commit261523d195a39620182074a9cff7792a9a37d2a0 (patch)
treedb4c30c6761b6fa6100352d15c31409694621cc9 /audio/mpg123
parenteff78fdd8c418faa35ba1e4e3b68c0615c2a8d5c (diff)
downloadFreeBSD-ports-261523d195a39620182074a9cff7792a9a37d2a0.zip
FreeBSD-ports-261523d195a39620182074a9cff7792a9a37d2a0.tar.gz
Remove patches that break audio capability detection, as well as a patch
that works around a driver bug that was fixed a year ago. PR: ports/33617, ports/32670, ports/35009, ports/32669
Diffstat (limited to 'audio/mpg123')
-rw-r--r--audio/mpg123/Makefile2
-rw-r--r--audio/mpg123/files/patch-ab10
-rw-r--r--audio/mpg123/files/patch-ad97
-rw-r--r--audio/mpg123/files/patch-audio.c105
4 files changed, 2 insertions, 212 deletions
diff --git a/audio/mpg123/Makefile b/audio/mpg123/Makefile
index 6d2a561..b2c424a 100644
--- a/audio/mpg123/Makefile
+++ b/audio/mpg123/Makefile
@@ -7,7 +7,7 @@
PORTNAME= mpg123
PORTVERSION= 0.59r
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= audio ipv6
MASTER_SITES= http://www.mpg123.de/mpg123/ \
http://www-ti.informatik.uni-tuebingen.de/~hippm/mpg123/ \
diff --git a/audio/mpg123/files/patch-ab b/audio/mpg123/files/patch-ab
index bce0ace..3d935ba 100644
--- a/audio/mpg123/files/patch-ab
+++ b/audio/mpg123/files/patch-ab
@@ -51,15 +51,7 @@ $FreeBSD$
old_rate = ai.rate;
old_format = ai.format;
old_channels = ai.channels;
-@@ -652,7 +659,6 @@
- break;
- }
-
-- init_output();
- if(ai.rate != old_rate || ai.channels != old_channels ||
- ai.format != old_format || param.force_reopen) {
- if(param.force_mono < 0) {
-@@ -787,6 +793,10 @@
+@@ -787,6 +794,10 @@
_wildcard(&argc,&argv);
#endif
diff --git a/audio/mpg123/files/patch-ad b/audio/mpg123/files/patch-ad
deleted file mode 100644
index 7de40fa..0000000
--- a/audio/mpg123/files/patch-ad
+++ /dev/null
@@ -1,97 +0,0 @@
---- audio_oss.c.orig Mon Feb 12 21:51:27 2001
-+++ audio_oss.c Mon Feb 12 22:12:27 2001
-@@ -143,12 +143,21 @@
-
- int audio_set_channels(struct audio_info_struct *ai)
- {
-- int chan = ai->channels - 1;
-+ int chan = ai->channels - 1, avail;
- int ret;
-
- if(ai->channels < 0)
- return 0;
-
-+ if (ioctl(ai->fn, SNDCTL_DSP_GETFMTS, &avail) < 0) {
-+ perror("SNDCTL_DSP_GETFMTS");
-+ return -1;
-+ }
-+
-+ if (chan && (avail & AFMT_STEREO) == 0) {
-+ return -1;
-+ }
-+
- ret = ioctl(ai->fn, SNDCTL_DSP_STEREO, &chan);
- if(chan != (ai->channels-1)) {
- return -1;
-@@ -158,8 +167,8 @@
-
- int audio_set_format(struct audio_info_struct *ai)
- {
-- int sample_size,fmts;
-- int sf,ret;
-+ int sample_size, fmts, avail;
-+ int sf;
-
- if(ai->format == -1)
- return 0;
-@@ -194,17 +203,33 @@
- if(ioctl(ai->fn, SNDCTL_DSP_SAMPLESIZE,&sample_size) < 0)
- return -1;
- #endif
-+
-+ /* newpcm note: need to check format is available before setting,
-+ * otherwise driver will not successfully change speed or channels
-+ * as format maybe incorrectly set in driver. newpcm probably needs
-+ * modifying to stop broken formats sticking. */
-+ if (ioctl(ai->fn, SNDCTL_DSP_GETFMTS, &avail) < 0) {
-+ perror("SNDCTL_DSP_GETFMTS");
-+ return -1;
-+ }
-+
-+ if ((fmts & avail) == 0) {
-+ return -1;
-+ }
-+
- sf = fmts;
-- ret = ioctl(ai->fn, SNDCTL_DSP_SETFMT, &fmts);
-+ if (ioctl(ai->fn, SNDCTL_DSP_SETFMT, &fmts) < 0) {
-+ perror("SNDCTL_DSP_SETFMT");
-+ return -1;
-+ }
- if(sf != fmts) {
- return -1;
- }
-- return ret;
-+ return 0;
- }
-
- /*
-- * get formats for specific channel/rate parameters
-- */
-+ * get formats for specific channel/rate parameters */
- int audio_get_formats(struct audio_info_struct *ai)
- {
- int fmt = 0;
-@@ -219,17 +244,17 @@
-
- for(i=0;i<6;i++) {
- ai->format = fmts[i];
-- if(audio_set_format(ai) < 0) {
-+ ai->rate = r;
-+ if(audio_rate_best_match(ai) < 0) {
- continue;
-- }
-+ }
- ai->channels = c;
- if(audio_set_channels(ai) < 0) {
- continue;
- }
-- ai->rate = r;
-- if(audio_rate_best_match(ai) < 0) {
-+ if(audio_set_format(ai) < 0) {
- continue;
-- }
-+ }
- if( (ai->rate*100 > r*(100-AUDIO_RATE_TOLERANCE)) && (ai->rate*100 < r*(100+AUDIO_RATE_TOLERANCE)) ) {
- fmt |= fmts[i];
- }
diff --git a/audio/mpg123/files/patch-audio.c b/audio/mpg123/files/patch-audio.c
deleted file mode 100644
index 29e475a..0000000
--- a/audio/mpg123/files/patch-audio.c
+++ /dev/null
@@ -1,105 +0,0 @@
-
-$FreeBSD$
-
---- audio.c.orig Tue Apr 6 18:53:05 1999
-+++ audio.c Tue Aug 21 19:38:08 2001
-@@ -62,8 +62,45 @@
- AUDIO_FORMAT_ALAW_8
- };
-
-+/* 0: not checked
-+ * 1: capable
-+ * -1: not capable
-+ */
- static char capabilities[NUM_CHANNELS][NUM_ENCODINGS][NUM_RATES];
-
-+/* true (1): capable
-+ * false (0): not capable
-+ */
-+static char get_capabilities(struct audio_info_struct *ai,
-+ int channel,int encoding,int rate) {
-+ /* printf("get_capabilities(%d,%d,%d)\n",channel,encoding,rate); */
-+ if (capabilities[channel][encoding][rate] == 0) {
-+ struct audio_info_struct ai1 = *ai;
-+ int fmts;
-+ int k;
-+ ai1.channels = channels[channel];
-+ ai1.rate = rates[rate];
-+ fmts = audio_get_formats(&ai1);
-+ /*printf("fmts=%x\n",fmts); */
-+ fflush(stdout);
-+ if (fmts < 0)
-+ for (k=0; k<NUM_ENCODINGS; k++)
-+ capabilities[channel][k][rate] = -1;
-+ else
-+ for (k=0; k<NUM_ENCODINGS; k++)
-+ if ((fmts & encodings[k]) == encodings[k])
-+ capabilities[channel][k][rate] = 1;
-+ else
-+ capabilities[channel][k][rate] = -1;
-+ }
-+ switch (capabilities[channel][encoding][rate]){
-+ case 1: return 1;
-+ case -1: return 0;
-+ default:
-+ abort();
-+ }
-+}
-+
- void audio_capabilities(struct audio_info_struct *ai)
- {
- int fmts;
-@@ -86,6 +123,8 @@
- exit(1);
- }
-
-+ /*
-+
- for(i=0;i<NUM_CHANNELS;i++) {
- for(j=0;j<NUM_RATES;j++) {
- ai1.channels = channels[i];
-@@ -100,7 +139,7 @@
- }
- }
-
-- audio_close(&ai1);
-+ */
-
- if(param.verbose > 1) {
- fprintf(stderr,"\nAudio capabilities:\n |");
-@@ -111,13 +150,13 @@
- for(k=0;k<k1;k++) {
- fprintf(stderr," %5d |",rates[k]);
- for(j=0;j<NUM_ENCODINGS;j++) {
-- if(capabilities[0][j][k]) {
-- if(capabilities[1][j][k])
-+ if(get_capabilities(&ai1,0,j,k)) {
-+ if(get_capabilities(&ai1,1,j,k))
- fprintf(stderr," M/S |");
- else
- fprintf(stderr," M |");
- }
-- else if(capabilities[1][j][k])
-+ else if(get_capabilities(&ai1,1,j,k))
- fprintf(stderr," S |");
- else
- fprintf(stderr," |");
-@@ -126,6 +165,9 @@
- }
- fprintf(stderr,"\n");
- }
-+
-+ audio_close(&ai1);
-+
- }
-
- static int rate2num(int r)
-@@ -144,7 +186,7 @@
-
- if(rn >= 0) {
- for(i=f0;i<f2;i++) {
-- if(capabilities[c][i][rn]) {
-+ if(get_capabilities(ai,c,i,rn)) {
- ai->rate = rates[rn];
- ai->format = encodings[i];
- ai->channels = channels[c];
OpenPOWER on IntegriCloud