remap-source, virtual-source: fix max_rewind handling

The filter sources should have the same max_rewind as the master source,
but these modules didn't update max_rewind when the master max_rewind
changed.
This commit is contained in:
Tanu Kaskinen 2017-10-31 15:29:26 +02:00
parent 83e12c43b1
commit 27067dbc75
2 changed files with 24 additions and 0 deletions

View file

@ -175,6 +175,17 @@ static void source_output_process_rewind_cb(pa_source_output *o, size_t nbytes)
pa_source_process_rewind(u->source, nbytes); pa_source_process_rewind(u->source, nbytes);
} }
/* Called from output thread context */
static void source_output_update_max_rewind_cb(pa_source_output *o, size_t nbytes) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_source_output_assert_io_context(o);
pa_assert_se(u = o->userdata);
pa_source_set_max_rewind_within_thread(u->source, nbytes);
}
/* Called from output thread context */ /* Called from output thread context */
static void source_output_detach_cb(pa_source_output *o) { static void source_output_detach_cb(pa_source_output *o) {
struct userdata *u; struct userdata *u;
@ -387,6 +398,7 @@ int pa__init(pa_module*m) {
u->source_output->push = source_output_push_cb; u->source_output->push = source_output_push_cb;
u->source_output->process_rewind = source_output_process_rewind_cb; u->source_output->process_rewind = source_output_process_rewind_cb;
u->source_output->update_max_rewind = source_output_update_max_rewind_cb;
u->source_output->kill = source_output_kill_cb; u->source_output->kill = source_output_kill_cb;
u->source_output->attach = source_output_attach_cb; u->source_output->attach = source_output_attach_cb;
u->source_output->detach = source_output_detach_cb; u->source_output->detach = source_output_detach_cb;

View file

@ -370,6 +370,17 @@ static void source_output_process_rewind_cb(pa_source_output *o, size_t nbytes)
#endif #endif
} }
/* Called from output thread context */
static void source_output_update_max_rewind_cb(pa_source_output *o, size_t nbytes) {
struct userdata *u;
pa_source_output_assert_ref(o);
pa_source_output_assert_io_context(o);
pa_assert_se(u = o->userdata);
pa_source_set_max_rewind_within_thread(u->source, nbytes);
}
/* Called from output thread context */ /* Called from output thread context */
static void source_output_attach_cb(pa_source_output *o) { static void source_output_attach_cb(pa_source_output *o) {
struct userdata *u; struct userdata *u;
@ -605,6 +616,7 @@ int pa__init(pa_module*m) {
u->source_output->push = source_output_push_cb; u->source_output->push = source_output_push_cb;
u->source_output->process_rewind = source_output_process_rewind_cb; u->source_output->process_rewind = source_output_process_rewind_cb;
u->source_output->update_max_rewind = source_output_update_max_rewind_cb;
u->source_output->kill = source_output_kill_cb; u->source_output->kill = source_output_kill_cb;
u->source_output->attach = source_output_attach_cb; u->source_output->attach = source_output_attach_cb;
u->source_output->detach = source_output_detach_cb; u->source_output->detach = source_output_detach_cb;