mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
null-sink: add an option that allows rewinds to be disabled
This commit is contained in:
parent
b943caa17f
commit
851e884516
1 changed files with 12 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue