summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_oss_out.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index 364c50049..6b5d2f57d 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_oss_out.c,v 1.25 2001/08/05 12:19:54 ehasenle Exp $
+ * $Id: audio_oss_out.c,v 1.26 2001/08/05 19:04:34 ehasenle Exp $
*/
/* required for swab() */
@@ -74,6 +74,9 @@
#define AUDIO_NUM_FRAGMENTS 15
#define AUDIO_FRAGMENT_SIZE 8192
+/* bufsize must be a multiple of 3 and 5 for 5.0 and 5.1 channel playback! */
+#define ZERO_BUF_SIZE 15360
+
#define GAP_TOLERANCE 5000
#define MAX_GAP 90000
@@ -301,10 +304,10 @@ static void ao_fill_gap (oss_functions_t *this, uint32_t pts_len) {
this->bytes_in_buffer += num_bytes;
- while (num_bytes>0) {
- if (num_bytes>8192) {
- write(this->audio_fd, this->zero_space, 8192);
- num_bytes -= 8192;
+ while (num_bytes > 0) {
+ if (num_bytes > ZERO_BUF_SIZE) {
+ write(this->audio_fd, this->zero_space, ZERO_BUF_SIZE);
+ num_bytes -= ZERO_BUF_SIZE;
} else {
write(this->audio_fd, this->zero_space, num_bytes);
num_bytes = 0;
@@ -690,8 +693,8 @@ ao_functions_t *init_audio_out_plugin (config_values_t *config) {
this->sample_buffer = malloc (40000);
memset (this->sample_buffer, 0, 40000);
- this->zero_space = malloc (8192);
- memset (this->zero_space, 0, 8192);
+ this->zero_space = malloc (ZERO_BUF_SIZE);
+ memset (this->zero_space, 0, ZERO_BUF_SIZE);
this->ao_functions.get_capabilities = ao_get_capabilities;
this->ao_functions.get_property = ao_get_property;