[vlc-devel] [PATCH 1/4] mmdevice: be informative about device state changes

Rémi Denis-Courmont remi at remlab.net
Tue May 24 18:59:38 CEST 2016


On Monday 23 May 2016 09:39:22 Thomas Guillem wrote:
> From: Sean McGovern <gseanmcg at gmail.com>
> 
> Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> ---
>  modules/audio_output/mmdevice.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/audio_output/mmdevice.c
> b/modules/audio_output/mmdevice.c index 286bc9d..a58b7dc 100644
> --- a/modules/audio_output/mmdevice.c
> +++ b/modules/audio_output/mmdevice.c
> @@ -613,8 +613,24 @@
> vlc_MMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *this,
> aout_sys_t *sys = vlc_MMNotificationClient_sys(this);
>      audio_output_t *aout = sys->aout;
> 
> -    /* TODO: show device state / ignore missing devices */
> -    msg_Dbg(aout, "device %ls state changed %08lx", wid, state);
> +    switch (state) {
> +        case DEVICE_STATE_UNPLUGGED:
> +            msg_Warn(aout, "device %ls was unplugged", wid);

Dbg and no verbs.

> +            break;
> +        case DEVICE_STATE_ACTIVE:
> +            msg_Warn(aout, "device %ls became active", wid);
> +            break;
> +        case DEVICE_STATE_DISABLED:
> +            msg_Warn(aout, "device %ls was disabled", wid);
> +            break;
> +        case DEVICE_STATE_NOTPRESENT:
> +            msg_Warn(aout, "device %ls is not present anymore", wid);
> +            break;
> +        default:
> +            msg_Warn(aout, "device %ls: unknown state %08lx", wid, state);
> +            break;
> +    }
> +
>      return S_OK;
>  }

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list