diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-09-14 17:52:11 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-09-14 17:52:11 +0000 |
commit | 8c6593dabf3253e20fead143855267570a403c9a (patch) | |
tree | 46ab7f2f77375113d2e8f0461a512688b0aa8857 /polyp/sink-input.c | |
parent | 829656c5fcd7169e4c2f86f4ad5098ea9aaa5643 (diff) |
add module-combine
remove option "stay-root"
clean up pa_conf
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@199 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/sink-input.c')
-rw-r--r-- | polyp/sink-input.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/polyp/sink-input.c b/polyp/sink-input.c index 7763f261..0d59062d 100644 --- a/polyp/sink-input.c +++ b/polyp/sink-input.c @@ -36,7 +36,7 @@ #define CONVERT_BUFFER_LENGTH 4096 -struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, const struct pa_sample_spec *spec) { +struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, const struct pa_sample_spec *spec, int variable_rate) { struct pa_sink_input *i; struct pa_resampler *resampler = NULL; int r; @@ -48,7 +48,7 @@ struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, con return NULL; } - if (!pa_sample_spec_equal(spec, &s->sample_spec)) + if (variable_rate || !pa_sample_spec_equal(spec, &s->sample_spec)) if (!(resampler = pa_resampler_new(spec, &s->sample_spec, s->core->memblock_stat))) return NULL; @@ -199,3 +199,13 @@ void pa_sink_input_cork(struct pa_sink_input *i, int b) { if (n) pa_sink_notify(i->sink); } + +void pa_sink_input_set_rate(struct pa_sink_input *i, uint32_t rate) { + assert(i && i->resampler); + + if (i->sample_spec.rate == rate) + return; + + i->sample_spec.rate = rate; + pa_resampler_set_input_rate(i->resampler, rate); +} |