From 4fb68b91acef3cb37c014814d9e9de8ca9f22bf4 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Wed, 16 Mar 2011 16:08:23 +0530 Subject: core: Factor out passthrough checks into their own functions Since we currently have two mechanisms to signal a passthrough connection (non-PCM format or PA_SINK_INPUT_PASSTHROUGH flag), we move all the related checks into functions and use those everywhere. This makes things more consistent, and should we decide to get rid of the flag, we only need to change pa_sink_input_*_is_passthrough() accordingly. --- src/modules/alsa/alsa-sink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/alsa') diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 3f8f6d20..b98340b7 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -1058,7 +1058,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse pa_sink_input *i = PA_SINK_INPUT(data); int r = 0; - if (PA_LIKELY(pa_format_info_is_pcm(i->format))) + if (PA_LIKELY(!pa_sink_input_is_passthrough(i))) break; u->old_rate = u->sink->sample_spec.rate; @@ -1084,7 +1084,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse pa_sink_input *i = PA_SINK_INPUT(data); int r = 0; - if (PA_LIKELY(pa_format_info_is_pcm(i->format))) + if (PA_LIKELY(!pa_sink_input_is_passthrough(i))) break; /* Passthrough format, see if we need to reset sink sample rate */ -- cgit