diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-10-22 22:48:53 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-10-22 22:48:53 +0200 |
commit | 6ff9c1fb62f642f79079510b5d85e67d9014c41f (patch) | |
tree | 46af434735b2be7b264ddfe30ba430d1749ae470 /src/utils | |
parent | a2b3d252af673b7261198bb753375d40f9b5c0ee (diff) | |
download | pulseaudio-panda-6ff9c1fb62f642f79079510b5d85e67d9014c41f.tar.gz pulseaudio-panda-6ff9c1fb62f642f79079510b5d85e67d9014c41f.tar.bz2 pulseaudio-panda-6ff9c1fb62f642f79079510b5d85e67d9014c41f.zip |
don't set the volume of pacat unless it is explicitly set
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/pacat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/pacat.c b/src/utils/pacat.c index 99df5b9e..ea736e23 100644 --- a/src/utils/pacat.c +++ b/src/utils/pacat.c @@ -57,6 +57,7 @@ static char *stream_name = NULL, *client_name = NULL, *device = NULL; static int verbose = 0; static pa_volume_t volume = PA_VOLUME_NORM; +static int volume_is_set = 0; static pa_sample_spec sample_spec = { .format = PA_SAMPLE_S16LE, @@ -283,7 +284,7 @@ static void context_state_callback(pa_context *c, void *userdata) { if (mode == PLAYBACK) { pa_cvolume cv; - if ((r = pa_stream_connect_playback(stream, device, latency > 0 ? &buffer_attr : NULL, flags, pa_cvolume_set(&cv, sample_spec.channels, volume), NULL)) < 0) { + if ((r = pa_stream_connect_playback(stream, device, latency > 0 ? &buffer_attr : NULL, flags, volume_is_set ? pa_cvolume_set(&cv, sample_spec.channels, volume) : NULL, NULL)) < 0) { fprintf(stderr, _("pa_stream_connect_playback() failed: %s\n"), pa_strerror(pa_context_errno(c))); goto fail; } @@ -627,6 +628,7 @@ int main(int argc, char *argv[]) { case ARG_VOLUME: { int v = atoi(optarg); volume = v < 0 ? 0U : (pa_volume_t) v; + volume_is_set = 1; break; } |