]> code.delx.au - pulseaudio/commitdiff
sink-input: Keep reference ratio up-to-date
authorTanu Kaskinen <tanuk@iki.fi>
Wed, 3 Apr 2013 15:28:32 +0000 (18:28 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Tue, 9 Jul 2013 14:40:38 +0000 (17:40 +0300)
The reference ratio should always be kept up-to-date. If the reference
ratio is not updated when the input volume changes, the stale
reference ratio ends up being used as the new input volume when the
input is moved.

src/pulsecore/sink-input.c

index ffea078a59419bbef0e3950ba80b5a60c3431254..c6d540eaf7b589aa6e5635230927e7da81d3e91e 100644 (file)
@@ -1289,6 +1289,7 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s
         /* OK, we are in normal volume mode. The volume only affects
          * ourselves */
         set_real_ratio(i, volume);
+        i->reference_ratio = i->volume;
 
         /* Copy the new soft_volume to the thread_info struct */
         pa_assert_se(pa_asyncmsgq_send(i->sink->asyncmsgq, PA_MSGOBJECT(i), PA_SINK_INPUT_MESSAGE_SET_SOFT_VOLUME, NULL, 0, NULL) == 0);