From 0525a5d213bdf3bdb476888c2af8e2bffd1f48d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 8 Apr 2008 19:49:34 +0000 Subject: [PATCH] sys/oss/: More logging when probing (see #518474), some comments in _reset(). Original commit message from CVS: * sys/oss/gstosshelper.c: (gst_oss_helper_rate_check_rate): * sys/oss/gstosssink.c: (gst_oss_sink_reset): * sys/oss/gstosssrc.c: (gst_oss_src_reset): More logging when probing (see #518474), some comments in _reset(). --- ChangeLog | 7 +++++++ sys/oss/gstosshelper.c | 12 +++++++++--- sys/oss/gstosssink.c | 12 +++--------- sys/oss/gstosssrc.c | 11 +++-------- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index eea8895aa6..41a28f724b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-08 Tim-Philipp Müller + + * sys/oss/gstosshelper.c: (gst_oss_helper_rate_check_rate): + * sys/oss/gstosssink.c: (gst_oss_sink_reset): + * sys/oss/gstosssrc.c: (gst_oss_src_reset): + More logging when probing (see #518474), some comments in _reset(). + 2008-04-07 Julien Moutte * gst/rtp/gstrtph264pay.c: (gst_rtp_h264_pay_setcaps): Fix build diff --git a/sys/oss/gstosshelper.c b/sys/oss/gstosshelper.c index dea22ccfbd..cc81ad8111 100644 --- a/sys/oss/gstosshelper.c +++ b/sys/oss/gstosshelper.c @@ -352,14 +352,20 @@ gst_oss_helper_rate_check_rate (GstOssProbe * probe, int irate) GST_LOG ("checking format %d, channels %d, rate %d", format, n_channels, rate); ret = ioctl (probe->fd, SNDCTL_DSP_SETFMT, &format); - if (ret < 0 || format != probe->format) + if (ret < 0 || format != probe->format) { + GST_DEBUG ("unsupported format: %d (%d)", probe->format, format); return -1; + } ret = ioctl (probe->fd, SNDCTL_DSP_CHANNELS, &n_channels); - if (ret < 0) + if (ret < 0 || n_channels != probe->n_channels) { + GST_DEBUG ("unsupported channels: %d (%d)", probe->n_channels, n_channels); return -1; + } ret = ioctl (probe->fd, SNDCTL_DSP_SPEED, &rate); - if (ret < 0) + if (ret < 0) { + GST_DEBUG ("unsupported rate: %d (%d)", irate, rate); return -1; + } GST_DEBUG ("rate %d -> %d", irate, rate); diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c index 17f3964a1f..23e177b4e3 100644 --- a/sys/oss/gstosssink.c +++ b/sys/oss/gstosssink.c @@ -574,13 +574,7 @@ gst_oss_sink_delay (GstAudioSink * asink) static void gst_oss_sink_reset (GstAudioSink * asink) { -#if 0 - GstOssSink *oss; - gint ret; - - oss = GST_OSSSINK (asink); - - /* deadlocks on my machine... */ - ret = ioctl (oss->fd, SNDCTL_DSP_RESET, 0); -#endif + /* There's nothing we can do here really: OSS can't handle access to the + * same device/fd from multiple threads and might deadlock or blow up in + * other ways if we try an ioctl SNDCTL_DSP_RESET or similar */ } diff --git a/sys/oss/gstosssrc.c b/sys/oss/gstosssrc.c index 417bdcf076..06e17e75c6 100644 --- a/sys/oss/gstosssrc.c +++ b/sys/oss/gstosssrc.c @@ -542,12 +542,7 @@ gst_oss_src_delay (GstAudioSrc * asrc) static void gst_oss_src_reset (GstAudioSrc * asrc) { - GstOssSrc *oss; - - //gint ret; - - oss = GST_OSS_SRC (asrc); - - /* deadlocks on my machine... */ - //ret = ioctl (oss->fd, SNDCTL_DSP_RESET, 0); + /* There's nothing we can do here really: OSS can't handle access to the + * same device/fd from multiple threads and might deadlock or blow up in + * other ways if we try an ioctl SNDCTL_DSP_RESET or similar */ }