diff options
author | Wellington Wallace <wellingtonwallace@gmail.com> | 2019-05-04 13:21:21 -0300 |
---|---|---|
committer | Wellington Wallace Miguel Melo <wellingtonwallace@gmail.com> | 2019-05-04 16:39:16 +0000 |
commit | 16a7f1e02c9b8199c69a02b3933eece7af0ea83d (patch) | |
tree | 025131c246f25e5754cf6e635b899115aec07181 | |
parent | b89d33bb182c42db5ad3987b0e91b7bf62f421e8 (diff) | |
download | pulseaudio-16a7f1e02c9b8199c69a02b3933eece7af0ea83d.tar.gz |
null-sink: add an option that allows rewinds to be disabled
-rw-r--r-- | src/modules/module-null-sink.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c index 44d18555..6825998d 100644 --- a/src/modules/module-null-sink.c +++ b/src/modules/module-null-sink.c @@ -53,7 +53,8 @@ PA_MODULE_USAGE( "rate=<sample rate> " "channels=<number of channels> " "channel_map=<channel map>" - "formats=<semi-colon separated sink formats>"); + "formats=<semi-colon separated sink formats>" + "norewinds=<disable rewinds>"); #define DEFAULT_SINK_NAME "null" #define BLOCK_USEC (PA_USEC_PER_SEC * 2) @@ -71,6 +72,8 @@ struct userdata { pa_usec_t timestamp; pa_idxset *formats; + + bool norewinds; }; static const char* const valid_modargs[] = { @@ -81,6 +84,7 @@ static const char* const valid_modargs[] = { "channels", "channel_map", "formats", + "norewinds", NULL }; @@ -169,6 +173,9 @@ static void process_rewind(struct userdata *u, pa_usec_t now) { pa_assert(u); + if (u->norewinds) + goto do_nothing; + rewind_nbytes = u->sink->thread_info.rewind_nbytes; if (!PA_SINK_IS_OPENED(u->sink->thread_info.state) || rewind_nbytes <= 0) @@ -349,6 +356,10 @@ int pa__init(pa_module*m) { goto fail; } + if(pa_modargs_get_value_boolean(ma, "norewinds", &u->norewinds) < 0){ + pa_log("Failed to disable rewinds."); + } + u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY); pa_sink_new_data_done(&data); |