[vlc-commits] winstore: Except the IAudioClient through libvlc_audio_output_device_set
Hugo Beauzée-Luyssen
git at videolan.org
Tue Sep 20 19:02:40 CEST 2016
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Sep 20 18:44:15 2016 +0200| [ee7cf829f8d11c572fc8161b43608d1fd55746b2] | committer: Hugo Beauzée-Luyssen
winstore: Except the IAudioClient through libvlc_audio_output_device_set
Instead of expecting it as a libvlc parameter
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ee7cf829f8d11c572fc8161b43608d1fd55746b2
---
modules/audio_output/winstore.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/modules/audio_output/winstore.c b/modules/audio_output/winstore.c
index a292841..6918b73 100644
--- a/modules/audio_output/winstore.c
+++ b/modules/audio_output/winstore.c
@@ -239,21 +239,32 @@ static void Stop(audio_output_t *aout)
sys->stream = NULL;
}
+static int DeviceSelect(audio_output_t *aout, const char* psz_device)
+{
+ if( psz_device == NULL )
+ return VLC_EGENERIC;
+ char* psz_end;
+ intptr_t ptr = strtoll( psz_device, &psz_end, 16 );
+ if ( *psz_end != 0 )
+ return VLC_EGENERIC;
+ if (aout->sys->client == (IAudioClient*)ptr)
+ return VLC_SUCCESS;
+ aout->sys->client = (IAudioClient*)ptr;
+ aout_RestartRequest( aout, AOUT_RESTART_OUTPUT );
+ return VLC_SUCCESS;
+}
+
static int Open(vlc_object_t *obj)
{
audio_output_t *aout = (audio_output_t *)obj;
- IAudioClient* client = var_InheritInteger(aout, "winstore-audioclient");
- if (client == NULL)
- return VLC_EGENERIC;
-
aout_sys_t *sys = malloc(sizeof (*sys));
if (unlikely(sys == NULL))
return VLC_ENOMEM;
aout->sys = sys;
sys->stream = NULL;
- sys->client = client;
+ sys->client = NULL;
aout->start = Start;
aout->stop = Stop;
aout->time_get = TimeGet;
@@ -262,6 +273,7 @@ static int Open(vlc_object_t *obj)
aout->play = Play;
aout->pause = Pause;
aout->flush = Flush;
+ aout->device_select = DeviceSelect;
return VLC_SUCCESS;
}
@@ -276,9 +288,7 @@ static void Close(vlc_object_t *obj)
vlc_module_begin()
set_shortname("winstore")
set_description(N_("Windows Store audio output"))
- set_capability("audio output", 150)
- /* Pointer to the activated AudioClient* */
- add_integer("winstore-audioclient", 0x0, NULL, NULL, true);
+ set_capability("audio output", 0)
set_category(CAT_AUDIO)
set_subcategory(SUBCAT_AUDIO_AOUT)
add_shortcut("wasapi")
More information about the vlc-commits
mailing list