[pulseaudio-commits] r1560 - /branches/lennart/src/modules/module-alsa-sink.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sat Jul 28 16:49:40 PDT 2007
Author: lennart
Date: Sun Jul 29 01:49:39 2007
New Revision: 1560
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1560&root=3Dpulseaudio&vi=
ew=3Drev
Log:
minor cleanups
Modified:
branches/lennart/src/modules/module-alsa-sink.c
Modified: branches/lennart/src/modules/module-alsa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-alsa-sink.c?rev=3D1560&root=3Dpulseaudio&r1=3D1559&r2=3D1560&view=3Ddi=
ff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-alsa-sink.c (original)
+++ branches/lennart/src/modules/module-alsa-sink.c Sun Jul 29 01:49:39 2007
@@ -564,7 +564,7 @@
pa_assert(u->memchunk.length > 0);
=
p =3D pa_memblock_acquire(u->memchunk.memblock);
- t =3D snd_pcm_writei(u->pcm_handle, (uint8_t*) p + u->=
memchunk.index, u->memchunk.length / u->frame_size);
+ t =3D snd_pcm_writei(u->pcm_handle, (const uint8_t*) p=
+ u->memchunk.index, u->memchunk.length / u->frame_size);
pa_memblock_release(u->memchunk.memblock);
=
/* pa_log("wrote %i bytes of %u (%u)", t*u->frame_size=
, u->memchunk.length, l); */
@@ -654,11 +654,6 @@
} else
revents =3D 0;
=
- if (revents & ~(POLLOUT|POLLERR)) {
- pa_log("DSP shutdown.");
- goto fail;
- }
-
pa_assert((pollfd[POLLFD_ASYNCQ].revents & ~POLLIN) =3D=3D 0);
}
=
@@ -697,13 +692,13 @@
pa_assert(m);
=
if (!(ma =3D pa_modargs_new(m->argument, valid_modargs))) {
- pa_log("failed to parse module arguments");
+ pa_log("Failed to parse module arguments");
goto fail;
}
=
ss =3D c->default_sample_spec;
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANN=
EL_MAP_ALSA) < 0) {
- pa_log("failed to parse sample specification and channel map");
+ pa_log("Failed to parse sample specification and channel map");
goto fail;
}
=
@@ -715,7 +710,7 @@
frag_size =3D frame_size;
=
if (pa_modargs_get_value_u32(ma, "fragments", &nfrags) < 0 || pa_modar=
gs_get_value_u32(ma, "fragment_size", &frag_size) < 0) {
- pa_log("failed to parse buffer metrics");
+ pa_log("Failed to parse buffer metrics");
goto fail;
}
period_size =3D frag_size/frame_size;
@@ -809,7 +804,7 @@
u->sink->is_hardware =3D 1;
=
u->frame_size =3D frame_size;
- u->fragment_size =3D period_size * frame_size;
+ u->fragment_size =3D frag_size =3D period_size * frame_size;
u->nfragments =3D nfrags;
u->hwbuf_size =3D u->fragment_size * nfrags;
=
@@ -836,13 +831,13 @@
snd_mixer_selem_get_playback_volume_range(u->mixer_elem, &=
u->hw_volume_min, &u->hw_volume_max);
}
}
+ =
if (snd_mixer_selem_has_playback_switch(u->mixer_elem)) {
u->sink->get_mute =3D sink_get_mute_cb;
u->sink->set_mute =3D sink_set_mute_cb;
}
=
u->mixer_fdl =3D pa_alsa_fdlist_new();
- pa_assert(u->mixer_fdl);
=
if (pa_alsa_fdlist_set_mixer(u->mixer_fdl, u->mixer_handle, c->mai=
nloop) < 0) {
pa_log("failed to initialise file descriptor monitoring");
@@ -853,7 +848,6 @@
snd_mixer_elem_set_callback_private(u->mixer_elem, u);
} else
u->mixer_fdl =3D NULL;
-
=
if (!(u->thread =3D pa_thread_new(thread_func, u))) {
pa_log("Failed to create thread.");
@@ -872,9 +866,9 @@
=
if (ma)
pa_modargs_free(ma);
-
- if (pcm_info)
- snd_pcm_info_free(pcm_info);
+ =
+ if (pcm_info)
+ snd_pcm_info_free(pcm_info);
=
return ret;
=
@@ -924,9 +918,8 @@
}
=
pa_xfree(u->device_name);
-
+ pa_xfree(u);
+ =
snd_config_update_free_global();
- =
- pa_xfree(u);
-}
-
+}
+
More information about the pulseaudio-commits
mailing list