changeset 2382:9f1dc50ed75d

Remove calls into xconvert PAPI. These calls were deprecated in early 1.5 development, and have now been removed entirely from the PAPI.
author William Pitcock <nenolod@atheme.org>
date Tue, 12 Feb 2008 02:23:14 -0600
parents 75de016f8979
children fd19014c3254
files src/alsa/audio.c src/jack/jack.c
diffstat 2 files changed, 4 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
--- a/src/alsa/audio.c	Tue Feb 12 02:22:10 2008 -0600
+++ b/src/alsa/audio.c	Tue Feb 12 02:23:14 2008 -0600
@@ -91,12 +91,6 @@
 
 static struct snd_format * snd_format_from_xmms(AFormat fmt, int rate, int channels);
 
-static struct xmms_convert_buffers *convertb;
-
-static convert_func_t alsa_convert_func;
-static convert_channel_func_t alsa_stereo_convert_func;
-static convert_freq_func_t alsa_frequency_convert_func;
-
 static const struct {
 	AFormat xmms;
 	snd_pcm_format_t alsa;
@@ -292,8 +286,6 @@
 
 	alsa_cleanup_mixer();
 
-	aud_convert_buffers_destroy(convertb);
-	convertb = NULL;
 	g_free(inputf);
 	inputf = NULL;
 	g_free(effectf);
@@ -609,15 +601,6 @@
 	if (paused)
 		return;
 
-	if (alsa_convert_func != NULL)
-		length = alsa_convert_func(convertb, &data, length);
-	if (alsa_stereo_convert_func != NULL)
-		length = alsa_stereo_convert_func(convertb, &data, length);
-	if (alsa_frequency_convert_func != NULL)
-		length = alsa_frequency_convert_func(convertb, &data, length,
-						     effectf->rate,
-						     outputf->rate);
-
 	alsa_write_audio(data, length);
 }
 
@@ -765,8 +748,6 @@
 	if (!mixer)
 		alsa_setup_mixer();
 
-	convertb = aud_convert_buffers_new();
-
 	output_time_offset = 0;
 	alsa_total_written = alsa_hw_written = 0;
 	going = TRUE;
@@ -848,10 +829,6 @@
 
 	debug("alsa_setup");
 
-	alsa_convert_func = NULL;
-	alsa_stereo_convert_func = NULL;
-	alsa_frequency_convert_func = NULL;
-
 	g_free(outputf);
 	outputf = snd_format_from_xmms(f->xmms_format, f->rate, f->channels);
 
@@ -914,16 +891,7 @@
 
 	snd_pcm_hw_params_set_channels_near(alsa_pcm, hwparams, &outputf->channels);
 	if (outputf->channels != f->channels)
-	{
-		debug("Converting channels from %d to %d",
-		      f->channels, outputf->channels);
-		alsa_stereo_convert_func =
-			aud_convert_get_channel_func(outputf->xmms_format,
-						      outputf->channels,
-						      f->channels);
-		if (alsa_stereo_convert_func == NULL)
-			return -1;
-	}
+		return -1;
 
 	snd_pcm_hw_params_set_rate_near(alsa_pcm, hwparams, &outputf->rate, 0);
 	if (outputf->rate == 0)
@@ -932,15 +900,7 @@
 		return -1;
 	}
 	if (outputf->rate != f->rate)
-	{
-		debug("Converting samplerate from %d to %d",
-		      f->rate, outputf->rate);
-		alsa_frequency_convert_func =
-			aud_convert_get_frequency_func(outputf->xmms_format,
-							outputf->channels);
-		if (alsa_frequency_convert_func == NULL)
-			return -1;
-	}
+		return -1;
 
 	outputf->sample_bits = snd_pcm_format_physical_width(outputf->format);
 	outputf->bps = (outputf->rate * outputf->sample_bits * outputf->channels) >> 3;
--- a/src/jack/jack.c	Tue Feb 12 02:22:10 2008 -0600
+++ b/src/jack/jack.c	Tue Feb 12 02:23:14 2008 -0600
@@ -55,11 +55,6 @@
 static format_info_t effect;
 static format_info_t output;
 
-static convert_freq_func_t freq_convert; /* rate convert function */
-static struct xmms_convert_buffers *convertb; /* convert buffer */
-
-static int isXmmsFrequencyAvailable = 0;
-
 static gboolean output_opened; /* true if we have a connection to jack */
 
 static GtkWidget *dialog, *button, *label;
@@ -79,12 +74,6 @@
   if((errval = JACK_Close(driver)))
     ERR("error closing device, errval of %d\n", errval);
 
-  /* only clean this up if we have the function to call */
-  if(isXmmsFrequencyAvailable)
-  {
-    aud_convert_buffers_destroy(convertb); /* clean up the rate conversion buffers */
-  }
-
   return;
 }
 
@@ -227,15 +216,6 @@
   /* set the port connection mode */
   jack_set_port_connection_mode();
 
-  isXmmsFrequencyAvailable = 1;
-
-  /* only initialize this stuff if we have the functions available */
-  if(isXmmsFrequencyAvailable)
-  {
-    convertb = aud_convert_buffers_new ();
-    freq_convert = aud_convert_get_frequency_func(FMT_S16_LE, 2);
-  }
-
   output_opened = FALSE;
 }
 
@@ -345,26 +325,9 @@
   retval = JACK_Open(&driver, bits_per_sample, &rate, output.channels);
   output.frequency = rate; /* avoid compile warning as output.frequency differs in type
                               from what JACK_Open() wants for the type of the rate parameter */
-  if((retval == ERR_RATE_MISMATCH) && isXmmsFrequencyAvailable)
+  if((retval == ERR_RATE_MISMATCH))
   {
-    TRACE("xmms(input) wants rate of '%ld', jacks rate(output) is '%ld', opening at jack rate\n", input.frequency, output.frequency);
-
-    /* open the jack device with true jack's rate, return 0 upon failure */
-    retval = JACK_Open(&driver, bits_per_sample, &rate, output.channels);
-    output.frequency = rate; /* avoid compile warning as output.frequency differs in type
-                                from what JACK_Open() wants for the type of the rate parameter */
-    if(retval)
-    {
-      TRACE("failed to open jack with JACK_Open(), error %d\n", retval);
-      return 0;
-    }
-    TRACE("success!!\n");
-  } else if((retval == ERR_RATE_MISMATCH) && !isXmmsFrequencyAvailable)
-  {
-    TRACE("JACK_Open(), sample rate mismatch with no resampling routines available\n");
-
-    jack_sample_rate_error(); /* notify the user that we can't resample */
-
+    TRACE("set the resampling rate properly");
     return 0;
   } else if(retval != ERR_SUCCESS)
   {