mainloop: fix timeout assignment in pa_mainloop_prepare
authorshdown <shdownnine@gmail.com>
Sun, 9 Jun 2019 13:40:14 +0000 (13:40 +0000)
committershdown <shdownnine@gmail.com>
Sun, 9 Jun 2019 13:40:14 +0000 (13:40 +0000)
The function calculates the correct timeout (in microseconds) to assign
in the `u` variable, but then assigns `m->prepared_timeout` the value
of the `timeout` argument (in milliseconds).

src/pulse/mainloop.c

index 03d7248..0cb4af3 100644 (file)
@@ -802,7 +802,7 @@ int pa_mainloop_prepare(pa_mainloop *m, int timeout) {
             uint64_t u = (uint64_t) timeout * PA_USEC_PER_MSEC;
 
             if (u < m->prepared_timeout || m->prepared_timeout == PA_USEC_INVALID)
-                m->prepared_timeout = timeout;
+                m->prepared_timeout = u;
         }
     }