mirror of
https://github.com/videolan/vlc.git
synced 2024-12-04 15:26:23 +08:00
test: add coverage for audio output and device functions
This commit is contained in:
parent
b8258c78be
commit
490b5fd010
@ -68,12 +68,42 @@ static void test_audiovideofilterlists (const char ** argv, int argc)
|
||||
libvlc_release (vlc);
|
||||
}
|
||||
|
||||
static void test_audio_output (void)
|
||||
{
|
||||
libvlc_instance_t *vlc = libvlc_new (0, NULL);
|
||||
assert (vlc != NULL);
|
||||
|
||||
libvlc_audio_output_t *mods = libvlc_audio_output_list_get (vlc);
|
||||
assert (mods != NULL);
|
||||
|
||||
puts ("Audio outputs:");
|
||||
for (const libvlc_audio_output_t *o = mods; o != NULL; o = o->p_next)
|
||||
{
|
||||
libvlc_audio_output_device_t *devs;
|
||||
|
||||
printf(" %s: %s\n", o->psz_name, o->psz_description);
|
||||
|
||||
devs = libvlc_audio_output_device_list_get (vlc, o->psz_name);
|
||||
if (devs == NULL)
|
||||
continue;
|
||||
for (const libvlc_audio_output_device_t *d = devs;
|
||||
d != NULL;
|
||||
d = d->p_next)
|
||||
printf(" %s: %s\n", d->psz_device, d->psz_description);
|
||||
|
||||
libvlc_audio_output_device_list_release (devs);
|
||||
}
|
||||
libvlc_audio_output_list_release (mods);
|
||||
libvlc_release (vlc);
|
||||
}
|
||||
|
||||
int main (void)
|
||||
{
|
||||
test_init();
|
||||
|
||||
test_core (test_defaults_args, test_defaults_nargs);
|
||||
test_audiovideofilterlists (test_defaults_args, test_defaults_nargs);
|
||||
test_audio_output ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user