Fix behaviour of the driver with small files -- due to a stupid

bug sound was not played if the total amount of data written to
the device was less than one blocksize

Noticed by: NABETANI Masaki and FreeBSD-users-jp
This commit is contained in:
Luigi Rizzo 1998-10-22 11:20:33 +00:00
parent 4d65f11c4c
commit 824f5b2e35

View File

@ -4,7 +4,7 @@
* This file implements the new DMA routines for the sound driver. * This file implements the new DMA routines for the sound driver.
* AUTO DMA MODE (ISA DMA SIDE). * AUTO DMA MODE (ISA DMA SIDE).
* *
* Copyright by Luigi Rizzo - 1997 * Copyright by Luigi Rizzo - 1997-98
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -180,7 +180,7 @@ dsp_wrintr(snddev_info *d)
* This happens if the size has changed _and_ the new size * This happens if the size has changed _and_ the new size
* is smaller, or it matches the blocksize. * is smaller, or it matches the blocksize.
*/ */
if (l != b->dl && (l < b->dl || l == d->play_blocksize) ) { if (l != b->dl && (b->dl == 0 || l<b->dl || l == d->play_blocksize) ) {
/* for any reason, size has changed. Stop and restart */ /* for any reason, size has changed. Stop and restart */
DEB(printf("wrintr: bsz change from %d to %d, rp %d rl %d\n", DEB(printf("wrintr: bsz change from %d to %d, rp %d rl %d\n",
b->dl, l, b->rp, b->rl)); b->dl, l, b->rp, b->rl));