diff options
-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 ) |