summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-01-12 16:09:58 +0000
committerPierre Ossman <ossman@cendio.se>2006-01-12 16:09:58 +0000
commit289c914b470537234c1de498cf195323826d7984 (patch)
tree8c63de7a803f5a69b8a135f397d4fb2bccb38498
parentfc93e4b3a722833ca6c1ad8a3c9af0b95b954000 (diff)
Some drivers (via82xx) doesn't start recording until we read something.
This is ugly, but unfortunately required. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@453 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--polyp/module-oss.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/polyp/module-oss.c b/polyp/module-oss.c
index d060b489..12cedf19 100644
--- a/polyp/module-oss.c
+++ b/polyp/module-oss.c
@@ -368,6 +368,15 @@ int pa__init(pa_core *c, pa_module*m) {
pa_modargs_free(ma);
+ /*
+ * Some crappy drivers do not start the recording until we read something.
+ * Without this snippet, poll will never register the fd as ready.
+ */
+ if (u->source) {
+ char buf[u->sample_size];
+ read(u->fd, buf, u->sample_size);
+ }
+
return 0;
fail: