diff --git a/ChangeLog b/ChangeLog index 8ef2237046..3e7ec34028 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-11 Ronald S. Bultje + + * ext/alsa/gstalsa.c: (gst_alsa_rates_probe): + Fix dmix. + 2005-01-11 Ronald S. Bultje * gst/playback/gstplaybasebin.c: (gst_play_base_bin_class_init), diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 9eb7908ebc..15c53ff9c6 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -852,9 +852,11 @@ gst_alsa_rates_probe (snd_pcm_t * device_handle, { unsigned int common_rates[] = { 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 dir; @@ -871,13 +873,16 @@ 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)); - + common_rates[12] = min_rate; + if (min_rate != max_rate) + common_rates[13] = max_rate; ret = gst_alsa_check_sample_rates (device_handle, hw_params, uncommon_rates, supported_rates); 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_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); } } else { - /* No sample rate supported ?! WTF */ - return 0; + GST_WARNING ("No supported samplerates found for %d-%d range", + min_rate, max_rate); + gst_value_set_int_range (supported_rates, min_rate, max_rate); } }