mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
don't set the volume of pacat unless it is explicitly set
This commit is contained in:
parent
a2b3d252af
commit
6ff9c1fb62
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue