audio: fill up last buffer with silence on close
This commit is contained in:
parent
b274842f5c
commit
6888db2820
1 changed files with 15 additions and 0 deletions
|
@ -326,6 +326,20 @@ ac97write(Audio *adev, void *vp, long n, vlong)
|
||||||
return p - (uchar*)vp;
|
return p - (uchar*)vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ac97close(Audio *adev)
|
||||||
|
{
|
||||||
|
Ctlr *ctlr;
|
||||||
|
Ring *ring;
|
||||||
|
uchar z[1];
|
||||||
|
|
||||||
|
z[0] = 0;
|
||||||
|
ctlr = adev->ctlr;
|
||||||
|
ring = &ctlr->outring;
|
||||||
|
while(ring->wi % Blocksize)
|
||||||
|
ac97write(adev, z, sizeof(z), 0);
|
||||||
|
}
|
||||||
|
|
||||||
static Pcidev*
|
static Pcidev*
|
||||||
ac97match(Pcidev *p)
|
ac97match(Pcidev *p)
|
||||||
{
|
{
|
||||||
|
@ -499,6 +513,7 @@ Found:
|
||||||
ac97mixreset(adev, ac97mixw, ac97mixr);
|
ac97mixreset(adev, ac97mixw, ac97mixr);
|
||||||
|
|
||||||
adev->write = ac97write;
|
adev->write = ac97write;
|
||||||
|
adev->close = ac97close;
|
||||||
adev->buffered = ac97buffered;
|
adev->buffered = ac97buffered;
|
||||||
adev->status = ac97status;
|
adev->status = ac97status;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue