summaryrefslogtreecommitdiff
path: root/plugins/oss
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2014-06-27 00:21:35 +0400
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2014-06-27 00:21:35 +0400
commit5351e2f52bc77bb1b94e98af6b0dc829606ee0a3 (patch)
tree573ff0ee1a15df71129b7a77018d65b25c6044c2 /plugins/oss
parent3031fb0b877495e98233b2728cbb4a2bf5dbbe11 (diff)
oss: always reopen sound device before changing output format
Diffstat (limited to 'plugins/oss')
-rw-r--r--plugins/oss/oss.c18
1 files changed, 7 insertions, 11 deletions
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 = {