[pulseaudio-discuss] [PATCH] rtp-recv: Only free rtpoll if it actually exist

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Wed Jan 15 08:39:28 PST 2014


On Wed, 2014-01-15 at 15:56 +0000, Javier Jardón wrote:
> From: Javier Jardón <javier.jardon at codethink.co.uk>
> 
> ---
>  src/modules/rtp/module-rtp-recv.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
> index fe9cf5d..bc47dd2 100644
> --- a/src/modules/rtp/module-rtp-recv.c
> +++ b/src/modules/rtp/module-rtp-recv.c
> @@ -407,12 +407,14 @@ static void sink_input_attach(pa_sink_input *i) {
>  /* Called from I/O thread context */
>  static void sink_input_detach(pa_sink_input *i) {
>      struct session *s;
> +
>      pa_sink_input_assert_ref(i);
>      pa_assert_se(s = i->userdata);
>  
> -    pa_assert(s->rtpoll_item);
> -    pa_rtpoll_item_free(s->rtpoll_item);
> -    s->rtpoll_item = NULL;
> +    if (s->rtpoll_item) {
> +        pa_rtpoll_item_free(s->rtpoll_item);
> +        s->rtpoll_item = NULL;
> +    }

The assertion is there for a reason. Sink inputs shouldn't be detached
if they haven't been attached first, and the only way s->rtpoll_item can
be NULL if the sink_input_attach() hasn't been called. So, to me the bug
seems to be that sink_input_detach() is called without first calling
sink_input_attach(). Could you figure out why that happens?

-- 
Tanu



More information about the pulseaudio-discuss mailing list