ext/alsa/gstalsa.c: Fix for if items are already in list...

Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_rates_probe):
Fix for if items are already in list...
This commit is contained in:
Ronald S. Bultje 2005-01-13 11:46:19 +00:00
parent f2bbca6587
commit af9b02817f
2 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2005-01-13 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/alsa/gstalsa.c: (gst_alsa_rates_probe):
Fix for if items are already in list...
2005-01-12 Benjamin Otte <otte@gnome.org>
* gst/adder/gstadder.c: (gst_adder_loop):

View file

@ -850,6 +850,8 @@ static int
gst_alsa_rates_probe (snd_pcm_t * device_handle,
snd_pcm_hw_params_t * hw_params, GValue * supported_rates)
{
int n;
gboolean min_found = FALSE, max_found = FALSE;
unsigned int common_rates[] =
{ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 88200,
96000, 192000, 0, 0, 0
@ -873,8 +875,15 @@ gst_alsa_rates_probe (snd_pcm_t * device_handle,
max_rate >
GST_ALSA_MAX_RATE ? GST_ALSA_MAX_RATE : (max_rate +
GST_ALSA_DIR_MAX (dir));
for (n = 0; common_rates[n] != 0; n++) {
if (common_rates[n] == min_rate)
min_found = TRUE;
if (common_rates[n] == max_rate)
max_found = TRUE;
}
if (!min_found)
common_rates[12] = min_rate;
if (min_rate != max_rate)
if (!max_found && min_rate != max_rate)
common_rates[13] = max_rate;
ret =