mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
daemon: get rid of win32 message timer
We don't need a timer to check for Windows messages anymore now that our fancy new poll() implementation does that for us.
This commit is contained in:
parent
f70ec2776a
commit
6f4e08140f
2 changed files with 8 additions and 36 deletions
|
|
@ -114,27 +114,6 @@ int deny_severity = LOG_WARNING;
|
||||||
int __padsp_disabled__ = 7;
|
int __padsp_disabled__ = 7;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OS_IS_WIN32
|
|
||||||
|
|
||||||
static void message_cb(pa_mainloop_api*a, pa_time_event*e, const struct timeval *tv, void *userdata) {
|
|
||||||
MSG msg;
|
|
||||||
struct timeval tvnext;
|
|
||||||
|
|
||||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
|
|
||||||
if (msg.message == WM_QUIT)
|
|
||||||
raise(SIGTERM);
|
|
||||||
else {
|
|
||||||
TranslateMessage(&msg);
|
|
||||||
DispatchMessage(&msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pa_timeval_add(pa_gettimeofday(&tvnext), 100000);
|
|
||||||
a->time_restart(e, &tvnext);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) {
|
static void signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) {
|
||||||
pa_log_info(_("Got signal %s."), pa_sig2str(sig));
|
pa_log_info(_("Got signal %s."), pa_sig2str(sig));
|
||||||
|
|
||||||
|
|
@ -409,10 +388,6 @@ int main(int argc, char *argv[]) {
|
||||||
#ifdef HAVE_FORK
|
#ifdef HAVE_FORK
|
||||||
int daemon_pipe[2] = { -1, -1 };
|
int daemon_pipe[2] = { -1, -1 };
|
||||||
int daemon_pipe2[2] = { -1, -1 };
|
int daemon_pipe2[2] = { -1, -1 };
|
||||||
#endif
|
|
||||||
#ifdef OS_IS_WIN32
|
|
||||||
pa_time_event *win32_timer;
|
|
||||||
struct timeval win32_tv;
|
|
||||||
#endif
|
#endif
|
||||||
int autospawn_fd = -1;
|
int autospawn_fd = -1;
|
||||||
bool autospawn_locked = false;
|
bool autospawn_locked = false;
|
||||||
|
|
@ -1071,10 +1046,6 @@ int main(int argc, char *argv[]) {
|
||||||
pa_signal_new(SIGHUP, signal_callback, c);
|
pa_signal_new(SIGHUP, signal_callback, c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OS_IS_WIN32
|
|
||||||
win32_timer = pa_mainloop_get_api(mainloop)->time_new(pa_mainloop_get_api(mainloop), pa_gettimeofday(&win32_tv), message_cb, NULL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!conf->no_cpu_limit)
|
if (!conf->no_cpu_limit)
|
||||||
pa_assert_se(pa_cpu_limit_init(pa_mainloop_get_api(mainloop)) == 0);
|
pa_assert_se(pa_cpu_limit_init(pa_mainloop_get_api(mainloop)) == 0);
|
||||||
|
|
||||||
|
|
@ -1169,11 +1140,6 @@ finish:
|
||||||
pa_autospawn_lock_done(false);
|
pa_autospawn_lock_done(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OS_IS_WIN32
|
|
||||||
if (mainloop && win32_timer)
|
|
||||||
pa_mainloop_get_api(mainloop)->time_free(win32_timer);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (c) {
|
if (c) {
|
||||||
/* Ensure all the modules/samples are unloaded when the core is still ref'ed,
|
/* Ensure all the modules/samples are unloaded when the core is still ref'ed,
|
||||||
* as unlink callback hooks in modules may need the core to be ref'ed */
|
* as unlink callback hooks in modules may need the core to be ref'ed */
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ typedef unsigned long nfds_t;
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <conio.h>
|
# include <conio.h>
|
||||||
|
# include <signal.h>
|
||||||
# if 0
|
# if 0
|
||||||
# include "msvc-nothrow.h"
|
# include "msvc-nothrow.h"
|
||||||
# endif
|
# endif
|
||||||
|
|
@ -567,11 +568,16 @@ restart:
|
||||||
/* new input of some other kind */
|
/* new input of some other kind */
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0)
|
while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0)
|
||||||
|
{
|
||||||
|
if (msg.message == WM_QUIT)
|
||||||
|
raise(SIGTERM);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
TranslateMessage (&msg);
|
TranslateMessage (&msg);
|
||||||
DispatchMessage (&msg);
|
DispatchMessage (&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue