Hello community, here is the log from the commit of package alsa-plugins for openSUSE:Factory checked in at Mon Aug 3 18:16:06 CEST 2009. -------- --- alsa-plugins/alsa-plugins.changes 2009-07-30 17:06:54.000000000 +0200 +++ /mounts/work_src_done/STABLE/alsa-plugins/alsa-plugins.changes 2009-08-03 12:39:57.000000000 +0200 @@ -1,0 +2,9 @@ +Mon Aug 3 12:38:48 CEST 2009 - tiwai@suse.de + +- update pulse plugin: + * get rid of a number of assert()s + * unify destruction of snd_pulse_t + * use PA_CONTEXT_IS_GOOD where applicable + * call pa_threaded_mainloop_wait() to handle spurious wakeups + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alsa-plugins.spec ++++++ --- /var/tmp/diff_new_pack.Nmvfpl/_old 2009-08-03 18:13:14.000000000 +0200 +++ /var/tmp/diff_new_pack.Nmvfpl/_new 2009-08-03 18:13:14.000000000 +0200 @@ -38,7 +38,7 @@ Url: http://www.alsa-project.org/ Summary: Extra Plug-Ins for the ALSA Library Version: 1.0.20 -Release: 5 +Release: 6 License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later Group: System/Libraries AutoReqProv: on ++++++ alsa-plugins-git-fixes.diff ++++++ --- /var/tmp/diff_new_pack.Nmvfpl/_old 2009-08-03 18:13:14.000000000 +0200 +++ /var/tmp/diff_new_pack.Nmvfpl/_new 2009-08-03 18:13:14.000000000 +0200 @@ -1,3 +1,16 @@ +diff --git a/configure.in b/configure.in +index 36740e9..f8bc669 100644 +--- a/configure.in ++++ b/configure.in +@@ -30,7 +30,7 @@ AC_ARG_ENABLE([pulseaudio], + AS_HELP_STRING([--disable-pulseaudio], [Disable building of pulseaudio plugin])) + + if test "x$enable_pulseaudio" != "xno"; then +- PKG_CHECK_MODULES(pulseaudio, [libpulse >= 0.9.2], [HAVE_PULSE=yes], [HAVE_PULSE=no]) ++ PKG_CHECK_MODULES(pulseaudio, [libpulse >= 0.9.11], [HAVE_PULSE=yes], [HAVE_PULSE=no]) + fi + AM_CONDITIONAL(HAVE_PULSE, test x$HAVE_PULSE = xyes) + diff --git a/doc/speexdsp.txt b/doc/speexdsp.txt index 875fc19..5b5e5a0 100644 --- a/doc/speexdsp.txt @@ -109,11 +122,302 @@ return 0; } +diff --git a/pulse/ctl_pulse.c b/pulse/ctl_pulse.c +index c6cf9e2..2caa29b 100644 +--- a/pulse/ctl_pulse.c ++++ b/pulse/ctl_pulse.c +@@ -125,8 +125,9 @@ static void event_cb(pa_context * c, pa_subscription_event_type_t t, + pa_operation *o; + + assert(ctl); +- assert(ctl->p); +- assert(ctl->p->context); ++ ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return; + + o = pa_context_get_sink_info_by_name(ctl->p->context, ctl->sink, + sink_info_cb, ctl); +@@ -148,8 +149,9 @@ static int pulse_update_volume(snd_ctl_pulse_t * ctl) + pa_operation *o; + + assert(ctl); +- assert(ctl->p); +- assert(ctl->p->context); ++ ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return -EBADFD; + + o = pa_context_get_sink_info_by_name(ctl->p->context, ctl->sink, + sink_info_cb, ctl); +@@ -203,6 +205,9 @@ static int pulse_elem_list(snd_ctl_ext_t * ext, unsigned int offset, + + assert(ctl); + ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return -EBADFD; ++ + snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_MIXER); + + pa_threaded_mainloop_lock(ctl->p->mainloop); +@@ -260,7 +265,9 @@ static int pulse_get_attribute(snd_ctl_ext_t * ext, snd_ctl_ext_key_t key, + return -EINVAL; + + assert(ctl); +- assert(ctl->p); ++ ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return -EBADFD; + + pa_threaded_mainloop_lock(ctl->p->mainloop); + +@@ -311,7 +318,9 @@ static int pulse_read_integer(snd_ctl_ext_t * ext, snd_ctl_ext_key_t key, + pa_cvolume *vol = NULL; + + assert(ctl); +- assert(ctl->p); ++ ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return -EBADFD; + + pa_threaded_mainloop_lock(ctl->p->mainloop); + +@@ -361,7 +370,9 @@ static int pulse_write_integer(snd_ctl_ext_t * ext, snd_ctl_ext_key_t key, + pa_cvolume *vol = NULL; + + assert(ctl); +- assert(ctl->p && ctl->p->context); ++ ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return -EBADFD; + + pa_threaded_mainloop_lock(ctl->p->mainloop); + +@@ -465,6 +476,9 @@ static void pulse_subscribe_events(snd_ctl_ext_t * ext, int subscribe) + + assert(ctl); + ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return; ++ + pa_threaded_mainloop_lock(ctl->p->mainloop); + + ctl->subscribed = !!(subscribe & SND_CTL_EVENT_MASK_VALUE); +@@ -481,6 +495,9 @@ static int pulse_read_event(snd_ctl_ext_t * ext, snd_ctl_elem_id_t * id, + + assert(ctl); + ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return -EBADFD; ++ + pa_threaded_mainloop_lock(ctl->p->mainloop); + + if (!ctl->updated || !ctl->subscribed) +@@ -526,7 +543,9 @@ static int pulse_ctl_poll_revents(snd_ctl_ext_t * ext, struct pollfd *pfd, + int err = 0; + + assert(ctl); +- assert(ctl->p); ++ ++ if (!ctl->p || !ctl->p->mainloop || !ctl->p->context) ++ return -EBADFD; + + pa_threaded_mainloop_lock(ctl->p->mainloop); + diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c -index db8d1e1..c276839 100644 +index db8d1e1..24347f9 100644 --- a/pulse/pcm_pulse.c +++ b/pulse/pcm_pulse.c -@@ -739,6 +739,30 @@ static int pulse_close(snd_pcm_ioplug_t * io) +@@ -106,6 +106,9 @@ static int update_active(snd_pcm_pulse_t *pcm) { + + assert(pcm); + ++ if (!pcm->p) ++ return -EBADFD; ++ + ret = check_active(pcm); + if (ret < 0) + return ret; +@@ -125,7 +128,9 @@ static int pulse_start(snd_pcm_ioplug_t * io) + int err = 0, err_o = 0, err_u = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +@@ -174,7 +179,9 @@ static int pulse_stop(snd_pcm_ioplug_t * io) + int err = 0, err_o = 0, err_u = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +@@ -224,7 +231,9 @@ static int pulse_drain(snd_pcm_ioplug_t * io) + int err = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +@@ -259,7 +268,9 @@ static snd_pcm_sframes_t pulse_pointer(snd_pcm_ioplug_t * io) + snd_pcm_sframes_t ret = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + if (io->state == SND_PCM_STATE_XRUN) + return -EPIPE; +@@ -269,7 +280,10 @@ static snd_pcm_sframes_t pulse_pointer(snd_pcm_ioplug_t * io) + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +- assert(pcm->stream); ++ if (!pcm->stream) { ++ ret = -EBADFD; ++ goto finish; ++ } + + ret = pulse_check_connection(pcm->p); + if (ret < 0) +@@ -305,11 +319,16 @@ static int pulse_delay(snd_pcm_ioplug_t * io, snd_pcm_sframes_t * delayp) + pa_usec_t lat = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +- assert(pcm->stream); ++ if (!pcm->stream) { ++ err = -EBADFD; ++ goto finish; ++ } + + for (;;) { + err = pulse_check_connection(pcm->p); +@@ -354,11 +373,16 @@ static snd_pcm_sframes_t pulse_write(snd_pcm_ioplug_t * io, + snd_pcm_sframes_t ret = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +- assert(pcm->stream); ++ if (!pcm->stream) { ++ ret = -EBADFD; ++ goto finish; ++ } + + ret = pulse_check_connection(pcm->p); + if (ret < 0) +@@ -409,11 +433,16 @@ static snd_pcm_sframes_t pulse_read(snd_pcm_ioplug_t * io, + snd_pcm_sframes_t ret = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +- assert(pcm->stream); ++ if (!pcm->stream) { ++ ret = -EBADFD; ++ goto finish; ++ } + + ret = pulse_check_connection(pcm->p); + if (ret < 0) +@@ -480,7 +509,9 @@ static void stream_request_cb(pa_stream * p, size_t length, void *userdata) + snd_pcm_pulse_t *pcm = userdata; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return; + + update_active(pcm); + } +@@ -490,7 +521,9 @@ static void stream_underrun_cb(pa_stream * p, void *userdata) + snd_pcm_pulse_t *pcm = userdata; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return; + + pcm->underrun = 1; + } +@@ -499,7 +532,9 @@ static void stream_latency_cb(pa_stream *p, void *userdata) { + snd_pcm_pulse_t *pcm = userdata; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return; + + pa_threaded_mainloop_signal(pcm->p->mainloop, 0); + } +@@ -512,7 +547,9 @@ static int pulse_pcm_poll_revents(snd_pcm_ioplug_t * io, + snd_pcm_pulse_t *pcm = io->private_data; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +@@ -541,7 +578,9 @@ static int pulse_prepare(snd_pcm_ioplug_t * io) + unsigned c, d; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +@@ -645,7 +684,9 @@ static int pulse_hw_params(snd_pcm_ioplug_t * io, + int err = 0; + + assert(pcm); +- assert(pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + +@@ -739,6 +780,32 @@ static int pulse_close(snd_pcm_ioplug_t * io) return 0; } @@ -123,7 +427,9 @@ + int err = 0; + + assert (pcm); -+ assert (pcm->p); ++ ++ if (!pcm->p) ++ return -EBADFD; + + pa_threaded_mainloop_lock(pcm->p->mainloop); + @@ -144,7 +450,7 @@ static const snd_pcm_ioplug_callback_t pulse_playback_callback = { .start = pulse_start, .stop = pulse_stop, -@@ -750,6 +774,7 @@ static const snd_pcm_ioplug_callback_t pulse_playback_callback = { +@@ -750,6 +817,7 @@ static const snd_pcm_ioplug_callback_t pulse_playback_callback = { .prepare = pulse_prepare, .hw_params = pulse_hw_params, .close = pulse_close, @@ -152,6 +458,164 @@ }; +diff --git a/pulse/pulse.c b/pulse/pulse.c +index 3940238..6f58a7e 100644 +--- a/pulse/pulse.c ++++ b/pulse/pulse.c +@@ -32,12 +32,13 @@ int pulse_check_connection(snd_pulse_t * p) + pa_context_state_t state; + + assert(p); +- assert(p->context); +- assert(p->mainloop); ++ ++ if (!p->context || !p->mainloop) ++ return -EBADFD; + + state = pa_context_get_state(p->context); + +- if (state != PA_CONTEXT_READY) ++ if (!PA_CONTEXT_IS_GOOD(state)) + return -EIO; + + return 0; +@@ -77,8 +78,12 @@ int pulse_wait_operation(snd_pulse_t * p, pa_operation * o) + { + assert(p); + assert(o); +- assert(p->state == PULSE_STATE_READY); +- assert(p->mainloop); ++ ++ if (p->state != PULSE_STATE_READY) ++ return -EBADFD; ++ ++ if (!p->mainloop) ++ return -EBADFD; + + for (;;) { + int err; +@@ -103,8 +108,12 @@ int pulse_wait_stream_state(snd_pulse_t * p, pa_stream * stream, + + assert(p); + assert(stream); +- assert(p->state == PULSE_STATE_READY); +- assert(p->mainloop); ++ ++ if (p->state != PULSE_STATE_READY) ++ return -EBADFD; ++ ++ if (!p->mainloop) ++ return -EBADFD; + + for (;;) { + int err; +@@ -118,8 +127,7 @@ int pulse_wait_stream_state(snd_pulse_t * p, pa_stream * stream, + if (state == target) + break; + +- if (state == PA_STREAM_FAILED || +- state == PA_STREAM_TERMINATED) ++ if (!PA_STREAM_IS_GOOD(state)) + return -EIO; + + pa_threaded_mainloop_wait(p->mainloop); +@@ -197,7 +205,9 @@ snd_pulse_t *pulse_new(void) + + p->context = + pa_context_new(pa_threaded_mainloop_get_api(p->mainloop), buf); +- assert(p->context); ++ ++ if (!p->context) ++ goto fail; + + pa_context_set_state_callback(p->context, context_state_cb, p); + +@@ -207,36 +217,29 @@ snd_pulse_t *pulse_new(void) + return p; + + fail: ++ pulse_free(p); ++ ++ return NULL; ++} ++ ++void pulse_free(snd_pulse_t * p) ++{ + if (p->mainloop) + pa_threaded_mainloop_stop(p->mainloop); + +- if (p->context) ++ if (p->context) { ++ pa_context_disconnect(p->context); + pa_context_unref(p->context); ++ } + + if (p->mainloop) + pa_threaded_mainloop_free(p->mainloop); + +- if (p->main_fd >= 0) +- close(p->main_fd); +- + if (p->thread_fd >= 0) + close(p->thread_fd); + +- free(p); +- +- return NULL; +-} +- +-void pulse_free(snd_pulse_t * p) +-{ +- pa_threaded_mainloop_stop(p->mainloop); +- +- pa_context_disconnect(p->context); +- pa_context_unref(p->context); +- pa_threaded_mainloop_free(p->mainloop); +- +- close(p->thread_fd); +- close(p->main_fd); ++ if (p->main_fd >= 0) ++ close(p->main_fd); + + free(p); + } +@@ -246,9 +249,12 @@ int pulse_connect(snd_pulse_t * p, const char *server) + int err; + + assert(p); +- assert(p->context); +- assert(p->mainloop); +- assert(p->state == PULSE_STATE_INIT); ++ ++ if (!p->context || !p->mainloop) ++ return -EBADFD; ++ ++ if (p->state != PULSE_STATE_INIT) ++ return -EBADFD; + + pa_threaded_mainloop_lock(p->mainloop); + +@@ -256,10 +262,17 @@ int pulse_connect(snd_pulse_t * p, const char *server) + if (err < 0) + goto error; + +- pa_threaded_mainloop_wait(p->mainloop); ++ for (;;) { ++ pa_context_state_t state = pa_context_get_state(p->context); + +- if (pa_context_get_state(p->context) != PA_CONTEXT_READY) +- goto error; ++ if (!PA_CONTEXT_IS_GOOD(state)) ++ goto error; ++ ++ if (state == PA_CONTEXT_READY) ++ break; ++ ++ pa_threaded_mainloop_wait(p->mainloop); ++ } + + pa_threaded_mainloop_unlock(p->mainloop); + diff --git a/rate-lavc/rate_lavcrate.c b/rate-lavc/rate_lavcrate.c index ea2e2f5..14a2198 100644 --- a/rate-lavc/rate_lavcrate.c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org