~ubuntu-branches/ubuntu/oneiric/pulseaudio/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/0101-sink-source-Avoid-unnecessary-call-to-pa_rtclock_now.patch

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, David Henningsson, Daniel T Chen, Luke Yelavich
  • Date: 2011-09-29 10:01:56 UTC
  • mfrom: (1.18.13 upstream)
  • Revision ID: package-import@ubuntu.com-20110929100156-bmwwzj3054q2e1vc
Tags: 1:1.0-0ubuntu1
[ David Henningsson ]
* Fix "Parse failure" error with remote sources/sinks,
  thanks to Martin-Eric Racine for reporting/testing! (LP: #852902)
* Fix crash when dbus module does not load (LP: #855729)
* Add more bug fixes from upstream git

[ Daniel T Chen ]
* debian/copyright: Update all shipped sources
* Various xcb_*() bugs already fixed in Sep 2010 (LP: #642030,
  LP: #646583, LP: #646616, LP: #648104)
* Passthrough is supported in 1.0 (LP: #448024)
* PulseAudio + alsa-plugins route through PulseAudio by default
  (LP: #378382)

[ Luke Yelavich ]
* New upstream bugfix release
  - vala: Add has_type_id=false to all enums, structs and classes
  - module-switch-on-connect: Don't switch unlinked sink input and source
    outputs
  - alsa-mixer: Set "Front" control to 0 dB on headphone path
  - module-equalizer-sink: Use %z for printf of size_t variables
  - module-equalizer-sink: Use = in initialising variables
  - bluetooth/sbc: Use __asm__ keyword
  - module-equalizer-sink: Use correct limit in loop
  - Squash the last gcc warnings
  - Make gcc --std=c99 happy
  - device-restore: Simplify the migration of data to per-port keys.
  - stream-restore: Add in some variable sets that were missing from 9ffa93.
  - stream-restore: Add proper data validity checks to the legacy database
    entry read.
  - formats: The format code should be in libpulse, not libpulsecommon
  - formats: Export more functions needed for a clean build.
  - device-restore: Fix use-after-free error.
  - raop: Use the port supplied by avahi when connecting to RAOP devices.
  - loopback: New modargs: sink_input_properties and
    source_output_properties.
  - bluetooth: Bump DBus version to 1.3.0 and drop conditional code.
  - alsa: Tidy up argument descriptions
  - module-suspend-on-idle: Move vacuum code to core
  - alsa-mixer: Add support for the Microsoft Kinect Sensor device
  - modargs: Ensure modargs can be accessed in their raw form.
  - raop: Properly deal with the name coming from the device.
  - build-sys: Oops forgot to add the Kinect profile to the build system.
  - volume: Rename 'sync volume' to 'deferred volume'.
  - raop: Don't crash if fd is not open when trying to close it
  - doc: Update README with fresh links.
  - doc: Add info about running pulseaudio from the build dir
  - stream: Relax assert for extended API
  - def: Hide server-side sink/source flags
  - volume: Handle varying channel count for shared volumes
  - virtual: Make volume sharing on by default
  - equalizer: Use volume sharing by default
  - echo-cancel: Use volume sharing by default
  - sink,source: Avoid crash by not updating volume on shutdown
  - conf: Make sure module-dbus-protocol is loaded after
    module-default-device-restore
  - build-sys: bump soname
  - sink,source: Handle missing in the shared volume case
  - dbus: Don't crash if the module does not load
  - Fix crash in threaded message queues
  - build-sys: Switch to the tar-ustar format (as per a lot of GNOME stuff
    for 3.2) and distribute .xz files.
  - build-sys: bump soname
* Dropped patches, all applied upstream:
  - 0017-Avoid-crash-by-not-updating-volume-on-shutdown.patch
  - 0018-RAOP-Don-t-crash-if-fd-is-not-open-when-trying-to-cl.patch
  - 0019-Make-sure-module-dbus-protocol-is-loaded-after-modul.patch
  - 0100-vala-Add-has_type_id-false-to-all-enums-structs-and-.patch
  - 0101-module-switch-on-connect-Don-t-switch-unlinked-sink-.patch
  - 0102-alsa-mixer-Set-Front-control-to-0-dB-on-headphone-pa.patch
  - 0103-module-equalizer-sink-Use-z-for-printf-of-size_t-var.patch
  - 0104-module-equalizer-sink-Use-in-initialising-variables.patch
  - 0105-bluetooth-sbc-Use-__asm__-keyword.patch
  - 0106-module-equalizer-sink-Use-correct-limit-in-loop.patch
  - 0107-Squash-the-last-gcc-warnings.patch
  - 0108-Make-gcc-std-c99-happy.patch
  - 0109-device-restore-Simplify-the-migration-of-data-to-per.patch
  - 0110-stream-restore-Add-in-some-variable-sets-that-were-m.patch
  - 0111-stream-restore-Add-proper-data-validity-checks-to-th.patch
* Pull some post-1.0 fixes from upstream git master
  - 6878140 (extended: Fix doxygen comment style typos)
  - 6a9272f (sink,source: Avoid unnecessary call to pa_rtclock_now())
* debian/rules: Modules are now in a 1.0 directory
* Update symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 6a9272f950649fdf3650e23d08320093d6ef7a64 Mon Sep 17 00:00:00 2001
 
2
From: Arun Raghavan <arun.raghavan@collabora.co.uk>
 
3
Date: Tue, 27 Sep 2011 21:52:24 +0530
 
4
Subject: [PATCH 101/101] sink,source: Avoid unnecessary call to
 
5
 pa_rtclock_now()
 
6
 
 
7
pa_{sink,source}_volume_change_apply were being called by the ALSA I/O
 
8
thread on every iteration, causing a pa_rtclock_now() call, which can
 
9
sometimes be heavy. We avoid this call by making sure there actually are
 
10
changes to apply before proceeding into the function.
 
11
 
 
12
While we're at it, also dropping a redundant check on s->write_volume.
 
13
---
 
14
 src/pulsecore/sink.c   |    8 +++++---
 
15
 src/pulsecore/source.c |    8 +++++---
 
16
 2 files changed, 10 insertions(+), 6 deletions(-)
 
17
 
 
18
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
 
19
index 21c6723..05b08aa 100644
 
20
--- a/src/pulsecore/sink.c
 
21
+++ b/src/pulsecore/sink.c
 
22
@@ -3400,12 +3400,12 @@ static void pa_sink_volume_change_flush(pa_sink *s) {
 
23
 
 
24
 /* Called from the IO thread. */
 
25
 pa_bool_t pa_sink_volume_change_apply(pa_sink *s, pa_usec_t *usec_to_next) {
 
26
-    pa_usec_t now = pa_rtclock_now();
 
27
+    pa_usec_t now;
 
28
     pa_bool_t ret = FALSE;
 
29
 
 
30
     pa_assert(s);
 
31
 
 
32
-    if (!PA_SINK_IS_LINKED(s->state)) {
 
33
+    if (!s->thread_info.volume_changes || !PA_SINK_IS_LINKED(s->state)) {
 
34
         if (usec_to_next)
 
35
             *usec_to_next = 0;
 
36
         return ret;
 
37
@@ -3413,6 +3413,8 @@ pa_bool_t pa_sink_volume_change_apply(pa_sink *s, pa_usec_t *usec_to_next) {
 
38
 
 
39
     pa_assert(s->write_volume);
 
40
 
 
41
+    now = pa_rtclock_now();
 
42
+
 
43
     while (s->thread_info.volume_changes && now >= s->thread_info.volume_changes->at) {
 
44
         pa_sink_volume_change *c = s->thread_info.volume_changes;
 
45
         PA_LLIST_REMOVE(pa_sink_volume_change, s->thread_info.volume_changes, c);
 
46
@@ -3423,7 +3425,7 @@ pa_bool_t pa_sink_volume_change_apply(pa_sink *s, pa_usec_t *usec_to_next) {
 
47
         pa_sink_volume_change_free(c);
 
48
     }
 
49
 
 
50
-    if (s->write_volume && ret)
 
51
+    if (ret)
 
52
         s->write_volume(s);
 
53
 
 
54
     if (s->thread_info.volume_changes) {
 
55
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
 
56
index 5239610..d47280c 100644
 
57
--- a/src/pulsecore/source.c
 
58
+++ b/src/pulsecore/source.c
 
59
@@ -2575,12 +2575,12 @@ static void pa_source_volume_change_flush(pa_source *s) {
 
60
 
 
61
 /* Called from the IO thread. */
 
62
 pa_bool_t pa_source_volume_change_apply(pa_source *s, pa_usec_t *usec_to_next) {
 
63
-    pa_usec_t now = pa_rtclock_now();
 
64
+    pa_usec_t now;
 
65
     pa_bool_t ret = FALSE;
 
66
 
 
67
     pa_assert(s);
 
68
 
 
69
-    if (!PA_SOURCE_IS_LINKED(s->state)) {
 
70
+    if (!s->thread_info.volume_changes || !PA_SOURCE_IS_LINKED(s->state)) {
 
71
         if (usec_to_next)
 
72
             *usec_to_next = 0;
 
73
         return ret;
 
74
@@ -2588,6 +2588,8 @@ pa_bool_t pa_source_volume_change_apply(pa_source *s, pa_usec_t *usec_to_next) {
 
75
 
 
76
     pa_assert(s->write_volume);
 
77
 
 
78
+    now = pa_rtclock_now();
 
79
+
 
80
     while (s->thread_info.volume_changes && now >= s->thread_info.volume_changes->at) {
 
81
         pa_source_volume_change *c = s->thread_info.volume_changes;
 
82
         PA_LLIST_REMOVE(pa_source_volume_change, s->thread_info.volume_changes, c);
 
83
@@ -2598,7 +2600,7 @@ pa_bool_t pa_source_volume_change_apply(pa_source *s, pa_usec_t *usec_to_next) {
 
84
         pa_source_volume_change_free(c);
 
85
     }
 
86
 
 
87
-    if (s->write_volume && ret)
 
88
+    if (ret)
 
89
         s->write_volume(s);
 
90
 
 
91
     if (s->thread_info.volume_changes) {
 
92
-- 
 
93
1.7.5.4
 
94