[pulseaudio-discuss] [PATCH] volume: Fix incorrect usage of PA_VOLUME_IS_VALID

2010-10-19 Thread Arun Raghavan
The commit that introduced this macro was incorrect in some places. This
patch fixes these. Thanks to Pierre-Louis Bossart for pointing this out.
---
 src/modules/dbus/iface-sample.c |4 ++--
 src/modules/dbus/iface-stream.c |2 +-
 src/modules/module-stream-restore.c |2 +-
 src/pulsecore/core-scache.c |4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/modules/dbus/iface-sample.c b/src/modules/dbus/iface-sample.c
index 2381079..93d4fc8 100644
--- a/src/modules/dbus/iface-sample.c
+++ b/src/modules/dbus/iface-sample.c
@@ -366,7 +366,7 @@ static void handle_play(DBusConnection *conn, DBusMessage 
*msg, void *userdata)
 if (!(property_list = pa_dbus_get_proplist_arg(conn, msg, msg_iter)))
 return;
 
-if (PA_VOLUME_IS_VALID(volume)) {
+if (!PA_VOLUME_IS_VALID(volume)) {
 pa_dbus_send_error(conn, msg, DBUS_ERROR_INVALID_ARGS, Invalid 
volume.);
 goto finish;
 }
@@ -416,7 +416,7 @@ static void handle_play_to_sink(DBusConnection *conn, 
DBusMessage *msg, void *us
 goto finish;
 }
 
-if (PA_VOLUME_IS_VALID(volume)) {
+if (!PA_VOLUME_IS_VALID(volume)) {
 pa_dbus_send_error(conn, msg, DBUS_ERROR_INVALID_ARGS, Invalid 
volume.);
 goto finish;
 }
diff --git a/src/modules/dbus/iface-stream.c b/src/modules/dbus/iface-stream.c
index 364572b..df00f0e 100644
--- a/src/modules/dbus/iface-stream.c
+++ b/src/modules/dbus/iface-stream.c
@@ -378,7 +378,7 @@ static void handle_set_volume(DBusConnection *conn, 
DBusMessage *msg, DBusMessag
 }
 
 for (i = 0; i  n_volume_entries; ++i) {
-if (PA_VOLUME_IS_VALID(volume[i])) {
+if (!PA_VOLUME_IS_VALID(volume[i])) {
 pa_dbus_send_error(conn, msg, DBUS_ERROR_INVALID_ARGS, Too large 
volume value: %u, volume[i]);
 return;
 }
diff --git a/src/modules/module-stream-restore.c 
b/src/modules/module-stream-restore.c
index 5ce1c41..37ab306 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -367,7 +367,7 @@ static int get_volume_arg(DBusConnection *conn, DBusMessage 
*msg, DBusMessageIte
 pa_assert_se(dbus_message_iter_next(struct_iter));
 dbus_message_iter_get_basic(struct_iter, chan_vol);
 
-if (PA_VOLUME_IS_VALID(chan_vol)) {
+if (!PA_VOLUME_IS_VALID(chan_vol)) {
 pa_dbus_send_error(conn, msg, DBUS_ERROR_INVALID_ARGS, Invalid 
volume: %u, chan_vol);
 return -1;
 }
diff --git a/src/pulsecore/core-scache.c b/src/pulsecore/core-scache.c
index cd388ef..5ec6159 100644
--- a/src/pulsecore/core-scache.c
+++ b/src/pulsecore/core-scache.c
@@ -336,12 +336,12 @@ int pa_scache_play_item(pa_core *c, const char *name, 
pa_sink *sink, pa_volume_t
 
 pass_volume = TRUE;
 
-if (e-volume_is_set  !PA_VOLUME_IS_VALID(volume)) {
+if (e-volume_is_set  PA_VOLUME_IS_VALID(volume)) {
 pa_cvolume_set(r, e-sample_spec.channels, volume);
 pa_sw_cvolume_multiply(r, r, e-volume);
 } else if (e-volume_is_set)
 r = e-volume;
-else if (!PA_VOLUME_IS_VALID(volume))
+else if (PA_VOLUME_IS_VALID(volume))
 pa_cvolume_set(r, e-sample_spec.channels, volume);
 else
 pass_volume = FALSE;
-- 
1.7.3.1

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] volume: Fix incorrect usage of PA_VOLUME_IS_VALID

2010-10-19 Thread Colin Guthrie
'Twas brillig, and Arun Raghavan at 19/10/10 08:33 did gyre and gimble:
 The commit that introduced this macro was incorrect in some places. This
 patch fixes these. Thanks to Pierre-Louis Bossart for pointing this out.

I thought I'd looked over all the cases where this was used to spot
these as I was mindful that this could have been a problem easily
introduced with this kind of change, but clearly I didn't do a good job.
So much for that :s

I've pushed this patch now as it's very obvious from looking at the
changes that it's needed.

Would be good if it did solve all of Pierre's issues too.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] volume: Fix incorrect usage of PA_VOLUME_IS_VALID

2010-10-19 Thread pl bossart
On Tue, Oct 19, 2010 at 3:56 AM, Colin Guthrie gm...@colin.guthr.ie wrote:
 'Twas brillig, and Arun Raghavan at 19/10/10 08:33 did gyre and gimble:
 The commit that introduced this macro was incorrect in some places. This
 patch fixes these. Thanks to Pierre-Louis Bossart for pointing this out.

 I thought I'd looked over all the cases where this was used to spot
 these as I was mindful that this could have been a problem easily
 introduced with this kind of change, but clearly I didn't do a good job.
 So much for that :s

 I've pushed this patch now as it's very obvious from looking at the
 changes that it's needed.

 Would be good if it did solve all of Pierre's issues too.

This patch corrects the issue I reported. Thanks Arun.
However I am now having problems with my multichannel files even when
the same volume is applied for all tracks constant high frequency
noise...more git bisect ahead of me...
-Pierre
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] volume: Fix incorrect usage of PA_VOLUME_IS_VALID

2010-10-19 Thread David Henningsson

On 2010-10-19 15:43, pl bossart wrote:

On Tue, Oct 19, 2010 at 3:56 AM, Colin Guthriegm...@colin.guthr.ie  wrote:

'Twas brillig, and Arun Raghavan at 19/10/10 08:33 did gyre and gimble:

The commit that introduced this macro was incorrect in some places. This
patch fixes these. Thanks to Pierre-Louis Bossart for pointing this out.


I thought I'd looked over all the cases where this was used to spot
these as I was mindful that this could have been a problem easily
introduced with this kind of change, but clearly I didn't do a good job.
So much for that :s

I've pushed this patch now as it's very obvious from looking at the
changes that it's needed.

Would be good if it did solve all of Pierre's issues too.


This patch corrects the issue I reported. Thanks Arun.
However I am now having problems with my multichannel files even when
the same volume is applied for all tracks constant high frequency
noise...more git bisect ahead of me...


It would also be good to know is PULSE_NO_SIMD=1 affects the HF noise, 
and if switching to stable-queue affects the HF noise?


--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss