From 5351e2f52bc77bb1b94e98af6b0dc829606ee0a3 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 27 Jun 2014 00:21:35 +0400 Subject: oss: always reopen sound device before changing output format --- plugins/oss/oss.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c index 74707a78..458b8a9f 100644 --- a/plugins/oss/oss.c +++ b/plugins/oss/oss.c @@ -73,7 +73,7 @@ oss_set_hwparams (ddb_waveformat_t *fmt) { break; } if (ioctl (fd, SNDCTL_DSP_SETFMT, &samplefmt) == -1) { - fprintf (stderr, "oss: failed to set format\n"); + fprintf (stderr, "oss: failed to set format (return: %d)\n", samplefmt); perror ("SNDCTL_DSP_SETFMT"); return -1; } @@ -211,18 +211,15 @@ oss_setformat (ddb_waveformat_t *fmt) { } int _state = state; - int v4workaround = deadbeef->conf_get_int ("oss.v4workaround", 0); deadbeef->mutex_lock (mutex); - if (v4workaround) { - if (fd) { - close (fd); - fd = 0; - } - fd = open (oss_device, O_WRONLY); - memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t)); + if (fd) { + close (fd); + fd = 0; } + fd = open (oss_device, O_WRONLY); + memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t)); if (0 != oss_set_hwparams (fmt)) { deadbeef->mutex_unlock (mutex); return -1; @@ -367,8 +364,7 @@ oss_load (DB_functions_t *api) { } static const char settings_dlg[] = - "property \"Device file\" entry oss.device /dev/dsp;\n" - "property \"OSS4 samplerate bug workaround\" checkbox oss.v4workaround 0;\n"; + "property \"Device file\" entry oss.device /dev/dsp;\n"; // define plugin interface static DB_output_t plugin = { -- cgit v1.2.3