mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 09:08:14 +00:00
ext/alsa/gstalsa.c: Fix dmix.
Original commit message from CVS: * ext/alsa/gstalsa.c: (gst_alsa_rates_probe): Fix dmix.
This commit is contained in:
parent
b92916a2bf
commit
dc9ff9e5c3
2 changed files with 17 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-01-11 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* ext/alsa/gstalsa.c: (gst_alsa_rates_probe):
|
||||||
|
Fix dmix.
|
||||||
|
|
||||||
2005-01-11 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
2005-01-11 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init),
|
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init),
|
||||||
|
|
|
@ -852,9 +852,11 @@ gst_alsa_rates_probe (snd_pcm_t * device_handle,
|
||||||
{
|
{
|
||||||
unsigned int common_rates[] =
|
unsigned int common_rates[] =
|
||||||
{ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 88200,
|
{ 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 88200,
|
||||||
96000, 192000, 0
|
96000, 192000, 0, 0, 0
|
||||||
};
|
};
|
||||||
unsigned int uncommon_rates[] = { 12345, 0 }; /* this dummy sample rate should only be supported by a software device */
|
/* this dummy sample rate should only be supported by a software device.
|
||||||
|
* you need two, because one could be dmix... */
|
||||||
|
unsigned int uncommon_rates[] = { 12345, 45678, 0 };
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
int dir;
|
int dir;
|
||||||
|
@ -871,13 +873,16 @@ gst_alsa_rates_probe (snd_pcm_t * device_handle,
|
||||||
max_rate >
|
max_rate >
|
||||||
GST_ALSA_MAX_RATE ? GST_ALSA_MAX_RATE : (max_rate +
|
GST_ALSA_MAX_RATE ? GST_ALSA_MAX_RATE : (max_rate +
|
||||||
GST_ALSA_DIR_MAX (dir));
|
GST_ALSA_DIR_MAX (dir));
|
||||||
|
common_rates[12] = min_rate;
|
||||||
|
if (min_rate != max_rate)
|
||||||
|
common_rates[13] = max_rate;
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
gst_alsa_check_sample_rates (device_handle, hw_params, uncommon_rates,
|
gst_alsa_check_sample_rates (device_handle, hw_params, uncommon_rates,
|
||||||
supported_rates);
|
supported_rates);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* Uncommon sample rates supported, it is certainly a "software"/dummy device */
|
/* Uncommon sample rates supported, it is certainly a
|
||||||
|
* "software"/dummy device */
|
||||||
g_value_unset (supported_rates);
|
g_value_unset (supported_rates);
|
||||||
g_value_init (supported_rates, GST_TYPE_INT_RANGE);
|
g_value_init (supported_rates, GST_TYPE_INT_RANGE);
|
||||||
|
|
||||||
|
@ -905,8 +910,9 @@ gst_alsa_rates_probe (snd_pcm_t * device_handle,
|
||||||
g_value_set_int (supported_rates, min_rate);
|
g_value_set_int (supported_rates, min_rate);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* No sample rate supported ?! WTF */
|
GST_WARNING ("No supported samplerates found for %d-%d range",
|
||||||
return 0;
|
min_rate, max_rate);
|
||||||
|
gst_value_set_int_range (supported_rates, min_rate, max_rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue