mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
commit
fc33f7ee97
56 changed files with 510 additions and 335 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include <pulse/volume.h>
|
||||
#include <pulse/timeval.h>
|
||||
#include <pulse/util.h>
|
||||
#include <pulse/rtclock.h>
|
||||
|
||||
#include <pulsecore/core-error.h>
|
||||
#include <pulsecore/module.h>
|
||||
|
|
@ -63,7 +64,7 @@ PA_MODULE_USAGE(
|
|||
"on_hotplug=<When new device becomes available, recheck streams?> "
|
||||
"on_rescue=<When device becomes unavailable, recheck streams?>");
|
||||
|
||||
#define SAVE_INTERVAL 10
|
||||
#define SAVE_INTERVAL (10 * PA_USEC_PER_SEC)
|
||||
#define IDENTIFICATION_PROPERTY "module-stream-restore.id"
|
||||
|
||||
static const char* const valid_modargs[] = {
|
||||
|
|
@ -121,12 +122,11 @@ enum {
|
|||
SUBCOMMAND_EVENT
|
||||
};
|
||||
|
||||
static void save_time_callback(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata) {
|
||||
static void save_time_callback(pa_mainloop_api*a, pa_time_event* e, const struct timeval *t, void *userdata) {
|
||||
struct userdata *u = userdata;
|
||||
|
||||
pa_assert(a);
|
||||
pa_assert(e);
|
||||
pa_assert(tv);
|
||||
pa_assert(u);
|
||||
|
||||
pa_assert(e == u->save_time_event);
|
||||
|
|
@ -220,7 +220,6 @@ fail:
|
|||
}
|
||||
|
||||
static void trigger_save(struct userdata *u) {
|
||||
struct timeval tv;
|
||||
pa_native_connection *c;
|
||||
uint32_t idx;
|
||||
|
||||
|
|
@ -240,9 +239,7 @@ static void trigger_save(struct userdata *u) {
|
|||
if (u->save_time_event)
|
||||
return;
|
||||
|
||||
pa_gettimeofday(&tv);
|
||||
tv.tv_sec += SAVE_INTERVAL;
|
||||
u->save_time_event = u->core->mainloop->time_new(u->core->mainloop, &tv, save_time_callback, u);
|
||||
u->save_time_event = pa_core_rttime_new(u->core, pa_rtclock_now() + SAVE_INTERVAL, save_time_callback, u);
|
||||
}
|
||||
|
||||
static pa_bool_t entries_equal(const struct entry *a, const struct entry *b) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue