Creating a stream might take some time, so check that it's in the right state
authorPierre Ossman <ossman@cendio.se>
Fri, 16 Jun 2006 21:08:35 +0000 (21:08 +0000)
committerPierre Ossman <ossman@cendio.se>
Fri, 16 Jun 2006 21:08:35 +0000 (21:08 +0000)
before transferring data.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1022 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/utils/padsp.c

index b0e7632..be93506 100644 (file)
@@ -767,7 +767,7 @@ static int fd_info_copy_data(fd_info *i, int force) {
 
     flags = 0;
 
-    if (i->play_stream) {
+    if ((i->play_stream) && (pa_stream_get_state(i->play_stream) == PA_STREAM_READY)) {
         n = pa_stream_writable_size(i->play_stream);
 
         if (n == (size_t)-1) {
@@ -810,7 +810,7 @@ static int fd_info_copy_data(fd_info *i, int force) {
             flags |= PA_IO_EVENT_INPUT;
     }
 
-    if (i->rec_stream) {
+    if ((i->rec_stream) && (pa_stream_get_state(i->rec_stream) == PA_STREAM_READY)) {
         n = pa_stream_readable_size(i->rec_stream);
 
         if (n == (size_t)-1) {