diff options
-rw-r--r-- | src/modules/alsa/alsa-mixer.c | 12 | ||||
-rw-r--r-- | src/pulse/def.h | 5 | ||||
-rw-r--r-- | src/pulsecore/memblock.c | 7 | ||||
-rw-r--r-- | src/utils/pacat.c | 14 |
4 files changed, 21 insertions, 17 deletions
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 685169b9..8d54d583 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -479,7 +479,6 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann snd_mixer_elem_t *me; snd_mixer_selem_channel_id_t c; pa_channel_position_mask_t mask = 0; - pa_volume_t max_channel_volume = PA_VOLUME_MUTED; unsigned k; pa_assert(m); @@ -546,9 +545,6 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann f = from_alsa_volume(value, e->min_volume, e->max_volume); } - if (f > max_channel_volume) - max_channel_volume = f; - for (k = 0; k < cm->channels; k++) if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) if (v->values[k] < f) @@ -559,7 +555,7 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann for (k = 0; k < cm->channels; k++) if (!(mask & PA_CHANNEL_POSITION_MASK(cm->map[k]))) - v->values[k] = max_channel_volume; + v->values[k] = PA_VOLUME_NORM; return 0; } @@ -681,7 +677,6 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann snd_mixer_elem_t *me; snd_mixer_selem_channel_id_t c; pa_channel_position_mask_t mask = 0; - pa_volume_t max_channel_volume = PA_VOLUME_MUTED; unsigned k; pa_assert(m); @@ -771,9 +766,6 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann f = from_alsa_volume(value, e->min_volume, e->max_volume); } - if (f > max_channel_volume) - max_channel_volume = f; - for (k = 0; k < cm->channels; k++) if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) if (rv.values[k] < f) @@ -784,7 +776,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann for (k = 0; k < cm->channels; k++) if (!(mask & PA_CHANNEL_POSITION_MASK(cm->map[k]))) - rv.values[k] = max_channel_volume; + rv.values[k] = PA_VOLUME_NORM; *v = rv; return 0; diff --git a/src/pulse/def.h b/src/pulse/def.h index 1a7da974..e839bd92 100644 --- a/src/pulse/def.h +++ b/src/pulse/def.h @@ -95,13 +95,14 @@ static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) { typedef enum pa_operation_state { PA_OPERATION_RUNNING, /**< The operation is still running */ PA_OPERATION_DONE, /**< The operation has been completed */ - PA_OPERATION_CANCELED /**< The operation has been canceled */ + PA_OPERATION_CANCELLED /**< The operation has been cancelled. Before 0.9.18 this was called PA_OPERATION_CANCELED. That name is still available for compatibility. */ } pa_operation_state_t; /** \cond fulldocs */ #define PA_OPERATION_RUNNING PA_OPERATION_RUNNING #define PA_OPERATION_DONE PA_OPERATION_DONE -#define PA_OPERATION_CANCELED PA_OPERATION_CANCELED +#define PA_OPERATION_CANCELED PA_OPERATION_CANCELLED +#define PA_OPERATION_CANCELLED PA_OPERATION_CANCELLED /** \endcond */ /** An invalid index */ diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c index 0e40d12b..47f298a4 100644 --- a/src/pulsecore/memblock.c +++ b/src/pulsecore/memblock.c @@ -303,10 +303,17 @@ static struct mempool_slot* mempool_slot_by_ptr(pa_mempool *p, void *ptr) { pa_memblock *pa_memblock_new_pool(pa_mempool *p, size_t length) { pa_memblock *b = NULL; struct mempool_slot *slot; + static int mempool_disable = 0; pa_assert(p); pa_assert(length); + if (mempool_disable == 0) + mempool_disable = getenv("PULSE_MEMPOOL_DISABLE") ? 1 : -1; + + if (mempool_disable > 0) + return NULL; + /* If -1 is passed as length we choose the size for the caller: we * take the largest size that fits in one of our slots. */ diff --git a/src/utils/pacat.c b/src/utils/pacat.c index 781bfa33..5f29ba39 100644 --- a/src/utils/pacat.c +++ b/src/utils/pacat.c @@ -430,14 +430,18 @@ static void context_state_callback(pa_context *c, void *userdata) { pa_stream_set_event_callback(stream, stream_event_callback, NULL); pa_stream_set_buffer_attr_callback(stream, stream_buffer_attr_callback, NULL); + pa_zero(buffer_attr); + buffer_attr.maxlength = (uint32_t) -1; + buffer_attr.prebuf = (uint32_t) -1; + if (latency > 0) { - memset(&buffer_attr, 0, sizeof(buffer_attr)); - buffer_attr.tlength = (uint32_t) latency; + buffer_attr.fragsize = buffer_attr.tlength = (uint32_t) latency; buffer_attr.minreq = (uint32_t) process_time; - buffer_attr.maxlength = (uint32_t) -1; - buffer_attr.prebuf = (uint32_t) -1; - buffer_attr.fragsize = (uint32_t) latency; flags |= PA_STREAM_ADJUST_LATENCY; + } else { + buffer_attr.tlength = (uint32_t) -1; + buffer_attr.minreq = (uint32_t) -1; + buffer_attr.fragsize = (uint32_t) -1; } if (mode == PLAYBACK) { |