output/alsa: fill period buffer with silence before draining

ALSA passes full period buffers to the hardware.  If an application
doesn't finish writing a period, libasound will nonetheless send the
partial buffer (with undefined trailing data).  This causes noise at
the end of playback.  This patch attempts to track the current
position within the period buffer, and generates silence at the end,
before calling snd_pcm_drain().
This commit is contained in:
Max Kellermann
2009-11-09 22:22:31 +01:00
parent 8420f1420f
commit 54033c74e4
2 changed files with 48 additions and 3 deletions

1
NEWS
View File

@@ -29,6 +29,7 @@ ver 0.16 (20??/??/??)
* output:
- recorder: new output plugin for recording radio streams
- alsa: don't recover on CANCEL
- alsa: fill period buffer with silence before draining
- openal: new output plugin
- pulse: announce "media.role=music"
- pulse: renamed context to "Music Player Daemon"