]> code.delx.au - pulseaudio/commitdiff
sink, source: Join two ifs with the same condition.
authorTanu Kaskinen <tanuk@iki.fi>
Mon, 31 Oct 2011 18:45:50 +0000 (20:45 +0200)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Wed, 2 Nov 2011 13:47:17 +0000 (19:17 +0530)
Changes in v2:
 * Moved the comment in source.c to the right place.

src/pulsecore/sink.c
src/pulsecore/source.c

index 454285fcd321b88f9c957b54d425abc996ef287b..eb67b47a1a6795e2025a915db9664e7ed91b30d7 100644 (file)
@@ -1943,13 +1943,7 @@ void pa_sink_set_volume(
         }
 
         pa_cvolume_remap(&new_reference_volume, &s->channel_map, &root_sink->channel_map);
-    }
-
-    /* If volume is NULL we synchronize the sink's real and reference
-     * volumes with the stream volumes. If it is not NULL we update
-     * the reference_volume with it. */
 
-    if (volume) {
         if (update_reference_volume(root_sink, &new_reference_volume, &root_sink->channel_map, save)) {
             if (pa_sink_flat_volume_enabled(root_sink)) {
                 /* OK, propagate this volume change back to the inputs */
@@ -1962,6 +1956,9 @@ void pa_sink_set_volume(
         }
 
     } else {
+        /* If volume is NULL we synchronize the sink's real and
+         * reference volumes with the stream volumes. */
+
         pa_assert(pa_sink_flat_volume_enabled(root_sink));
 
         /* Ok, let's determine the new real volume */
index 6da6ef249db11d03995721a654fd9ea30d8082cd..361780aeb7f16d03e5836f66ed8d83d80ad2ab50 100644 (file)
@@ -1508,13 +1508,7 @@ void pa_source_set_volume(
         }
 
         pa_cvolume_remap(&new_reference_volume, &s->channel_map, &root_source->channel_map);
-    }
-
-    /* If volume is NULL we synchronize the source's real and reference
-     * volumes with the stream volumes. If it is not NULL we update
-     * the reference_volume with it. */
 
-    if (volume) {
         if (update_reference_volume(root_source, &new_reference_volume, &root_source->channel_map, save)) {
             if (pa_source_flat_volume_enabled(root_source)) {
                 /* OK, propagate this volume change back to the outputs */
@@ -1527,6 +1521,9 @@ void pa_source_set_volume(
         }
 
     } else {
+        /* If volume is NULL we synchronize the source's real and
+         * reference volumes with the stream volumes. */
+
         pa_assert(pa_source_flat_volume_enabled(root_source));
 
         /* Ok, let's determine the new real volume */