summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink-input.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-13 02:17:24 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-13 02:17:24 +0200
commit5ee4069e9e68f81a71d208bb720d0c6bc6112fdc (patch)
treeee2244ea18f790632ab25e54826e0c9de7a0f84e /src/pulsecore/sink-input.c
parent9a95fe49c848d2711dcdcf4c407e626e41e4657f (diff)
core: add functions to query max_rewind/max_request values from streams
Diffstat (limited to 'src/pulsecore/sink-input.c')
-rw-r--r--src/pulsecore/sink-input.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index c7837298..1f67d0fb 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -803,6 +803,25 @@ void pa_sink_input_process_rewind(pa_sink_input *i, size_t nbytes /* in sink sam
}
/* Called from thread context */
+size_t pa_sink_input_get_max_rewind(pa_sink_input *i) {
+ pa_sink_input_assert_ref(i);
+ pa_sink_input_assert_io_context(i);
+
+ return i->thread_info.resampler ? pa_resampler_request(i->thread_info.resampler, i->sink->thread_info.max_rewind) : i->sink->thread_info.max_rewind;
+}
+
+/* Called from thread context */
+size_t pa_sink_input_get_max_request(pa_sink_input *i) {
+ pa_sink_input_assert_ref(i);
+ pa_sink_input_assert_io_context(i);
+
+ /* We're not verifying the status here, to allow this to be called
+ * in the state change handler between _INIT and _RUNNING */
+
+ return i->thread_info.resampler ? pa_resampler_request(i->thread_info.resampler, i->sink->thread_info.max_request) : i->sink->thread_info.max_request;
+}
+
+/* Called from thread context */
void pa_sink_input_update_max_rewind(pa_sink_input *i, size_t nbytes /* in the sink's sample spec */) {
pa_sink_input_assert_ref(i);
pa_sink_input_assert_io_context(i);