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

Steve Lhomme robux4 at ycbcr.xyz
Wed Jun 24 14:26:54 CEST 2020


---
 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;
         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);
 }
 
 static HRESULT ActivateDevice(void *opaque, REFIID iid, PROPVARIANT *actparms,
-- 
2.26.2



More information about the vlc-devel mailing list