mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
Huge trailing whitespace cleanup. Let's keep the tree pure from here on,
mmmkay? git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
1a460ee40a
commit
521daf6f0a
283 changed files with 3742 additions and 3742 deletions
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
/***
|
||||
This file is part of PulseAudio.
|
||||
|
||||
|
||||
PulseAudio is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
|
||||
PulseAudio is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with PulseAudio; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
|
|
@ -96,13 +96,13 @@ static void update_usage(struct userdata *u) {
|
|||
|
||||
static void clear_up(struct userdata *u) {
|
||||
assert(u);
|
||||
|
||||
|
||||
if (u->source) {
|
||||
pa_source_disconnect(u->source);
|
||||
pa_source_unref(u->source);
|
||||
u->source = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (u->pcm_fdl)
|
||||
pa_alsa_fdlist_free(u->pcm_fdl);
|
||||
if (u->mixer_fdl)
|
||||
|
|
@ -114,7 +114,7 @@ static void clear_up(struct userdata *u) {
|
|||
snd_mixer_close(u->mixer_handle);
|
||||
u->mixer_handle = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (u->pcm_handle) {
|
||||
snd_pcm_drop(u->pcm_handle);
|
||||
snd_pcm_close(u->pcm_handle);
|
||||
|
|
@ -127,7 +127,7 @@ static int xrun_recovery(struct userdata *u) {
|
|||
assert(u);
|
||||
|
||||
pa_log_info("*** ALSA-XRUN (capture) ***");
|
||||
|
||||
|
||||
if ((ret = snd_pcm_prepare(u->pcm_handle)) < 0) {
|
||||
pa_log("snd_pcm_prepare() failed: %s", snd_strerror(-ret));
|
||||
|
||||
|
|
@ -144,17 +144,17 @@ static void do_read(struct userdata *u) {
|
|||
assert(u);
|
||||
|
||||
update_usage(u);
|
||||
|
||||
|
||||
for (;;) {
|
||||
pa_memchunk post_memchunk;
|
||||
snd_pcm_sframes_t frames;
|
||||
size_t l;
|
||||
|
||||
|
||||
if (!u->memchunk.memblock) {
|
||||
u->memchunk.memblock = pa_memblock_new(u->source->core->mempool, u->memchunk.length = u->fragment_size);
|
||||
u->memchunk.index = 0;
|
||||
}
|
||||
|
||||
|
||||
assert(u->memchunk.memblock);
|
||||
assert(u->memchunk.length);
|
||||
assert(u->memchunk.memblock->data);
|
||||
|
|
@ -164,11 +164,11 @@ static void do_read(struct userdata *u) {
|
|||
if ((frames = snd_pcm_readi(u->pcm_handle, (uint8_t*) u->memchunk.memblock->data + u->memchunk.index, u->memchunk.length / u->frame_size)) < 0) {
|
||||
if (frames == -EAGAIN)
|
||||
return;
|
||||
|
||||
|
||||
if (frames == -EPIPE) {
|
||||
if (xrun_recovery(u) < 0)
|
||||
return;
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ static void do_read(struct userdata *u) {
|
|||
}
|
||||
|
||||
l = frames * u->frame_size;
|
||||
|
||||
|
||||
post_memchunk = u->memchunk;
|
||||
post_memchunk.length = l;
|
||||
|
||||
|
|
@ -188,13 +188,13 @@ static void do_read(struct userdata *u) {
|
|||
|
||||
u->memchunk.index += l;
|
||||
u->memchunk.length -= l;
|
||||
|
||||
|
||||
if (u->memchunk.length == 0) {
|
||||
pa_memblock_unref(u->memchunk.memblock);
|
||||
u->memchunk.memblock = NULL;
|
||||
u->memchunk.index = u->memchunk.length = 0;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -223,7 +223,7 @@ static int mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) {
|
|||
u->source->get_hw_volume(u->source);
|
||||
if (u->source->get_hw_mute)
|
||||
u->source->get_hw_mute(u->source);
|
||||
|
||||
|
||||
pa_subscription_post(u->source->core,
|
||||
PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE,
|
||||
u->source->index);
|
||||
|
|
@ -256,14 +256,14 @@ static int source_get_hw_volume_cb(pa_source *s) {
|
|||
|
||||
for (i = 0;i < s->hw_volume.channels;i++) {
|
||||
long set_vol;
|
||||
|
||||
|
||||
assert(snd_mixer_selem_has_capture_channel(u->mixer_elem, i));
|
||||
|
||||
|
||||
if ((err = snd_mixer_selem_get_capture_volume(u->mixer_elem, i, &vol)) < 0)
|
||||
goto fail;
|
||||
|
||||
set_vol = (long) roundf(((float) s->hw_volume.values[i] * (u->hw_volume_max - u->hw_volume_min)) / PA_VOLUME_NORM) + u->hw_volume_min;
|
||||
|
||||
|
||||
/* Try to avoid superfluous volume changes */
|
||||
if (set_vol != vol)
|
||||
s->hw_volume.values[i] = (pa_volume_t) roundf(((float) (vol - u->hw_volume_min) * PA_VOLUME_NORM) / (u->hw_volume_max - u->hw_volume_min));
|
||||
|
|
@ -361,7 +361,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
const char *name;
|
||||
char *name_buf = NULL;
|
||||
int namereg_fail;
|
||||
|
||||
|
||||
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
|
||||
pa_log("failed to parse module arguments");
|
||||
goto fail;
|
||||
|
|
@ -378,17 +378,17 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
/* Fix latency to 100ms */
|
||||
periods = 12;
|
||||
fragsize = pa_bytes_per_second(&ss)/128;
|
||||
|
||||
|
||||
if (pa_modargs_get_value_u32(ma, "fragments", &periods) < 0 || pa_modargs_get_value_u32(ma, "fragment_size", &fragsize) < 0) {
|
||||
pa_log("failed to parse buffer metrics");
|
||||
goto fail;
|
||||
}
|
||||
period_size = fragsize/frame_size;
|
||||
|
||||
|
||||
u = pa_xnew0(struct userdata, 1);
|
||||
m->userdata = u;
|
||||
u->module = m;
|
||||
|
||||
|
||||
snd_config_update_free_global();
|
||||
if ((err = snd_pcm_open(&u->pcm_handle, dev = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) {
|
||||
pa_log("Error opening PCM device %s: %s", dev, snd_strerror(err));
|
||||
|
|
@ -427,7 +427,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
name = name_buf = pa_sprintf_malloc("alsa_input.%s", dev);
|
||||
namereg_fail = 0;
|
||||
}
|
||||
|
||||
|
||||
if (!(u->source = pa_source_new(c, __FILE__, name, namereg_fail, &ss, &map))) {
|
||||
pa_log("Failed to create source object");
|
||||
goto fail;
|
||||
|
|
@ -490,7 +490,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
u->memchunk.index = u->memchunk.length = 0;
|
||||
|
||||
snd_pcm_start(u->pcm_handle);
|
||||
|
||||
|
||||
ret = 0;
|
||||
|
||||
/* Get initial mixer settings */
|
||||
|
|
@ -507,11 +507,11 @@ finish:
|
|||
|
||||
if (pcm_info)
|
||||
snd_pcm_info_free(pcm_info);
|
||||
|
||||
|
||||
return ret;
|
||||
|
||||
fail:
|
||||
|
||||
|
||||
if (u)
|
||||
pa__done(c, m);
|
||||
|
||||
|
|
@ -526,10 +526,10 @@ void pa__done(pa_core *c, pa_module*m) {
|
|||
return;
|
||||
|
||||
clear_up(u);
|
||||
|
||||
|
||||
if (u->memchunk.memblock)
|
||||
pa_memblock_unref(u->memchunk.memblock);
|
||||
|
||||
|
||||
pa_xfree(u);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue