diff options
author | 2011-04-05 21:57:37 +0200 | |
---|---|---|
committer | 2011-04-05 21:57:37 +0200 | |
commit | 5efe52afdea1fd6ffb2fd763023e3bca84c29a54 (patch) | |
tree | 4dba3ffb4cc1033d6fcd30caa8ea4f9bae63afb3 /plugins/oss | |
parent | 1d231ff272512af0159c837af5ac819d5ae957b9 (diff) |
fixed oss 24bit and multichannel glitches
Diffstat (limited to 'plugins/oss')
-rw-r--r-- | plugins/oss/oss.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c index 1570c2a0..953398af 100644 --- a/plugins/oss/oss.c +++ b/plugins/oss/oss.c @@ -282,7 +282,14 @@ oss_thread (void *context) { int res = 0; - char buf[BLOCKSIZE]; + int sample_size = plugin.fmt.channels * (plugin.fmt.bps / 8); + int bs = BLOCKSIZE; + int mod = bs % sample_size; + if (mod > 0) { + bs -= mod; + } + char buf[bs]; + int write_size = oss_callback (buf, sizeof (buf)); deadbeef->mutex_lock (mutex); if ( write_size > 0 ) |