~ubuntu-branches/ubuntu/quantal/pulseaudio/quantal-updates

« back to all changes in this revision

Viewing changes to debian/patches/0106-sink-Move-updating-the-requested-latency-after-the-r.patch

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich, David Henningsson, Luke Yelavich
  • Date: 2011-10-20 11:36:43 UTC
  • Revision ID: james.westby@ubuntu.com-20111020113643-pu2zh690bw7h755f
Tags: 1:1.0-0ubuntu4
[ David Henningsson ]
* Added patches:
  0103-module-jackdbus-detect-Avoid-double-free-of-modargs.patch:
    (LP: #867444)
  0104-source-output-Do-not-use-unset-channel-map-in-pa_sou.patch: 
    (LP: #864071)
  0105-Fix-deferred-volume-not-being-applied-if-sink-is-clo.patch,
  0017-Hack-around-a-bug-in-the-core-causing-volumes-not-to.patch:
    These two patches affect users not having their volume correctly
    set on port change (LP: #877954)

[ Luke Yelavich ]
* debian/control: Update Vcs-Bzr field
* 0102-Always-return-a-three-part-version-number-in-API-cal.patch: Refresh
  the patch from upstrea git, to refer to the correct commit hash, and
  update the description
* Pull some bug fixes from the stable-1.x upstream git branch:
  - 411af6b (sink: Move updating the requested latency after the rewind
             request when finishing a stream move.)
  - 87f70c6 (null-sink: Set latency range at the time of initialization of
             module.)
  - d71a291 (Make pulse build with clang again)
  - 4e5943b (alsa: Give compressed formats preference over PCM)
  - 867170a (alsa: Better error handling in mixer rtpoll callback)
  - c055c55 (echo-cancel: Fail if loaded between a sink and its monitor)
  - 8754e0c (doc: Add some more doxygen tags to existing comments)
  - 2c30c07 (alsa: Make mixer error handling more robust still)
  - 8a5e6e8 (echo-cancel: Don't crash if adjust_time = 0)
  - 7b13a79 (echo-cancel: Close debug files on module unload)
  - 6bf0489 (tests: Fix calculation of memblock size in resampler-test)
  - 93f55a4 (filter-apply: Move sink/source unlink callbacks before m-s-r)
  - b1dabfb (build-sys: Drop libsamplerate from pulsecommon deps)
  - 743a4d0 (build-sys: Provide a simple CMake Config setup (similar to
             pkgconfig))
* Add liborc-0.4-dev as a build dependency to add orc support
* debian/libpulse-dev.install: Ship cmake files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 411af6b61aa564907d65fad1893383a4eb0a4933 Mon Sep 17 00:00:00 2001
 
2
From: Tanu Kaskinen <tanu.kaskinen@digia.com>
 
3
Date: Thu, 29 Sep 2011 18:54:01 +0300
 
4
Subject: [PATCH 109/125] sink: Move updating the requested latency after the
 
5
 rewind request when finishing a stream move.
 
6
 
 
7
---
 
8
 src/pulsecore/sink.c |   29 +++++++++++++++++++++++------
 
9
 1 files changed, 23 insertions(+), 6 deletions(-)
 
10
 
 
11
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
 
12
index 05b08aa..a2642b4 100644
 
13
--- a/src/pulsecore/sink.c
 
14
+++ b/src/pulsecore/sink.c
 
15
@@ -2330,6 +2330,18 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
 
16
              * slow start, i.e. need some time to buffer client
 
17
              * samples before beginning streaming. */
 
18
 
 
19
+            /* FIXME: Actually rewinding should be requested before
 
20
+             * updating the sink requested latency, because updating
 
21
+             * the requested latency updates also max_rewind of the
 
22
+             * sink. Now consider this: a sink has a 10 s buffer and
 
23
+             * nobody has requested anything less. Then a new stream
 
24
+             * appears while the sink buffer is full. The new stream
 
25
+             * requests e.g. 100 ms latency. That request is forwarded
 
26
+             * to the sink, so now max_rewind is 100 ms. When a rewind
 
27
+             * is requested, the sink will only rewind 100 ms, and the
 
28
+             * new stream will have to wait about 10 seconds before it
 
29
+             * becomes audible. */
 
30
+
 
31
             /* In flat volume mode we need to update the volume as
 
32
              * well */
 
33
             return o->process_msg(o, PA_SINK_MESSAGE_SET_SHARED_VOLUME, NULL, 0, NULL);
 
34
@@ -2440,12 +2452,6 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
 
35
             if (i->attach)
 
36
                 i->attach(i);
 
37
 
 
38
-            if (i->thread_info.requested_sink_latency != (pa_usec_t) -1)
 
39
-                pa_sink_input_set_requested_latency_within_thread(i, i->thread_info.requested_sink_latency);
 
40
-
 
41
-            pa_sink_input_update_max_rewind(i, s->thread_info.max_rewind);
 
42
-            pa_sink_input_update_max_request(i, s->thread_info.max_request);
 
43
-
 
44
             if (i->thread_info.state != PA_SINK_INPUT_CORKED) {
 
45
                 pa_usec_t usec = 0;
 
46
                 size_t nbytes;
 
47
@@ -2461,6 +2467,17 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
 
48
                 pa_sink_request_rewind(s, nbytes);
 
49
             }
 
50
 
 
51
+            /* Updating the requested sink latency has to be done
 
52
+             * after the sink rewind request, not before, because
 
53
+             * otherwise the sink may limit the rewind amount
 
54
+             * needlessly. */
 
55
+
 
56
+            if (i->thread_info.requested_sink_latency != (pa_usec_t) -1)
 
57
+                pa_sink_input_set_requested_latency_within_thread(i, i->thread_info.requested_sink_latency);
 
58
+
 
59
+            pa_sink_input_update_max_rewind(i, s->thread_info.max_rewind);
 
60
+            pa_sink_input_update_max_request(i, s->thread_info.max_request);
 
61
+
 
62
             return o->process_msg(o, PA_SINK_MESSAGE_SET_SHARED_VOLUME, NULL, 0, NULL);
 
63
         }
 
64
 
 
65
-- 
 
66
1.7.5.4
 
67