[pulseaudio-discuss] [PATCH] cork-on-phone: Handle sink-inputs with NULL sinks

Colin Guthrie gmane at colin.guthr.ie
Mon Mar 28 05:34:41 PDT 2011


'Twas brillig, and Arun Raghavan at 28/03/11 12:09 did gyre and gimble:
> It's possible that by the time we receive the unlink hook, the given
> sink-input's sink is set to NULL. Handle this gracefully.
> ---
>  src/modules/module-cork-music-on-phone.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/src/modules/module-cork-music-on-phone.c b/src/modules/module-cork-music-on-phone.c
> index b629f06..5e6aa64 100644
> --- a/src/modules/module-cork-music-on-phone.c
> +++ b/src/modules/module-cork-music-on-phone.c
> @@ -138,6 +138,9 @@ static pa_hook_result_t process(struct userdata *u, pa_sink_input *i, pa_bool_t
>          !pa_streq(role, "video"))
>          return PA_HOOK_OK;
>  
> +    if (!i->sink)
> +        return PA_HOOK_OK;
> +
>      cork = shall_cork(i->sink, create ? NULL : i);
>      apply_cork(u, i->sink, create ? NULL : i, cork);
>  

Cheers. It's in my tree.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list