[vlc-devel] [PATCH 1/4] aout: winstore: rename vlc_FromHR to ResetInvalidated

Thomas Guillem thomas at gllm.fr
Thu Jun 25 10:22:38 CEST 2020



On Wed, Jun 24, 2020, at 14:26, Steve Lhomme wrote:
> ---
>  modules/audio_output/winstore.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/modules/audio_output/winstore.c b/modules/audio_output/winstore.c
> index 9fcd6768e01..6482bd41726 100644
> --- a/modules/audio_output/winstore.c
> +++ b/modules/audio_output/winstore.c
> @@ -57,16 +57,15 @@ typedef struct
>      IAudioClient *client;
>  } aout_sys_t;
>  
> -static int vlc_FromHR(audio_output_t *aout, HRESULT hr)
> +static void ResetInvalidated(audio_output_t *aout, HRESULT hr)
>  {
> -    aout_sys_t* sys = aout->sys;
>      /* Select the default device (and restart) on unplug */
>      if (unlikely(hr == AUDCLNT_E_DEVICE_INVALIDATED ||
>                   hr == AUDCLNT_E_RESOURCES_INVALIDATED))
>      {
> +        aout_sys_t* sys = aout->sys;

I don't like this change. If end up handling another case, we will have to move the sys initialization again.

>          sys->client = NULL;
>      }
> -    return SUCCEEDED(hr) ? 0 : -1;
>  }
>  
>  static int VolumeSet(audio_output_t *aout, float vol)
> @@ -160,7 +159,7 @@ static void Play(audio_output_t *aout, block_t 
> *block, vlc_tick_t date)
>      HRESULT hr = aout_stream_Play(sys->stream, block, date);
>      LeaveMTA();
>  
> -    vlc_FromHR(aout, hr);
> +    ResetInvalidated(aout, hr);
>      (void) date;
>  }
>  
> @@ -175,7 +174,7 @@ static void Pause(audio_output_t *aout, bool 
> paused, vlc_tick_t date)
>      LeaveMTA();
>  
>      (void) date;
> -    vlc_FromHR(aout, hr);
> +    ResetInvalidated(aout, hr);
>  }
>  
>  static void Flush(audio_output_t *aout)
> @@ -188,7 +187,7 @@ static void Flush(audio_output_t *aout)
>      HRESULT hr = aout_stream_Flush(sys->stream);
>      LeaveMTA();
>  
> -    vlc_FromHR(aout, hr);
> +    ResetInvalidated(aout, hr);

OK with me.

>  }
>  
>  static HRESULT ActivateDevice(void *opaque, REFIID iid, PROPVARIANT *actparms,
> -- 
> 2.26.2
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list