sys/oss/gstosselement.c: probe caps correctly for sound cards that only support one format

Original commit message from CVS:
* sys/oss/gstosselement.c: (gst_osselement_probe_caps),
(gst_osselement_rate_check_rate):
probe caps correctly for sound cards that only support one format
This commit is contained in:
Benjamin Otte 2004-03-30 18:01:45 +00:00
parent ba2e373927
commit 0941bfb00e
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2004-03-30 Benjamin Otte <in7y118@public.uni-hamburg.de>
* sys/oss/gstosselement.c: (gst_osselement_probe_caps),
(gst_osselement_rate_check_rate):
probe caps correctly for sound cards that only support one format
2004-03-30 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/kio/kiosrc.cpp: (process_events):

View file

@ -1038,7 +1038,7 @@ gst_osselement_probe_caps (GstOssElement * oss)
caps = gst_caps_new_empty ();
/* assume that the most significant bit of format_mask is 0 */
for (format_bit = 1; format_bit < format_mask; format_bit <<= 1) {
for (format_bit = 1; format_bit <= format_mask; format_bit <<= 1) {
if (format_bit & format_mask) {
GValue rate_value = { 0 };
@ -1257,6 +1257,8 @@ gst_osselement_rate_check_rate (GstOssProbe * probe, int irate)
format = probe->format;
n_channels = probe->n_channels;
GST_LOG ("checking format %d, channels %d, rate %d",
format, n_channels, rate);
ret = ioctl (probe->fd, SNDCTL_DSP_SETFMT, &format);
if (ret < 0)
return -1;