]> code.delx.au - pulseaudio/commitdiff
sink,source: Add the ability to disable alternat sample rate switching
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 17 Oct 2011 14:31:03 +0000 (20:01 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Mon, 17 Oct 2011 14:46:37 +0000 (20:16 +0530)
Setting the alternate sample rate to 0 in config disables this feature.

man/pulse-daemon.conf.5.xml.in
src/modules/alsa/alsa-sink.c
src/modules/alsa/alsa-source.c

index 33ea79204d0f40df09e7f8e7a870ac9c17187800..2c42f8ce0938c4c78406bb7f51b8003413cabaac 100644 (file)
@@ -420,7 +420,8 @@ USA.
       default-rate-rate value or this alternate value, typically 44.1
       or 48kHz. Switching between default and alternate values is
       enabled only when the sinks/sources are suspended. This option
-      is ignored in passthrough mode where the stream rate will be used.</p>
+      is ignored in passthrough mode where the stream rate will be used.
+      If set to zero, this feature is disabled.</p>
     </option>
 
   </section>
index 0b7bbe00bea8b3aa819e42136ef6f852925cc854..8ce4ed7b443728e08adf06435fc9ae68c906ae34 100644 (file)
@@ -2201,7 +2201,8 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
         u->sink->update_requested_latency = sink_update_requested_latency_cb;
     u->sink->set_state = sink_set_state_cb;
     u->sink->set_port = sink_set_port_cb;
-    u->sink->update_rate = sink_update_rate_cb;
+    if (u->sink->alternate_sample_rate)
+        u->sink->update_rate = sink_update_rate_cb;
     u->sink->userdata = u;
 
     pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
index c27942910c5eeaed760a9a4dbba70f7bd06563e5..180baca947b6a4c0f7f077eeee90cc3d615c0fc6 100644 (file)
@@ -1939,7 +1939,8 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
         u->source->update_requested_latency = source_update_requested_latency_cb;
     u->source->set_state = source_set_state_cb;
     u->source->set_port = source_set_port_cb;
-    u->source->update_rate = source_update_rate_cb;
+    if (u->source->alternate_sample_rate)
+        u->source->update_rate = source_update_rate_cb;
     u->source->userdata = u;
 
     pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);