SDL_CloseAudioDevice( vg_audio.sdl_output_device );
}
- if( vg_audio.force_device_name ){
- free( vg_audio.force_device_name );
- vg_audio.force_device_name = NULL;
- }
+ vg_strfree( &vg_audio.device_choice );
if( vg_settings.audio_devices.new_value == -1 ){ }
else if( vg_settings.audio_devices.new_value == -2 ){
}
}
- int len = strlen(oi->alias);
- vg_audio.force_device_name = malloc(len+1);
- memcpy( vg_audio.force_device_name, (void *)oi->alias, len+1 );
+ vg_strnull( &vg_audio.device_choice, NULL, -1 );
+ vg_strcat( &vg_audio.device_choice, oi->alias );
}
vg_audio_device_init();
oi->value = i;
}
- if( vg_audio.force_device_name ){
+ if( vg_audio.device_choice.buffer ){
vg_settings.temp_audio_choice = -2;
for( int i=0; i<count; i ++ ){
struct ui_enum_opt *oi = &options[i+1];
- if( !strcmp( oi->alias, vg_audio.force_device_name ) ){
+ if( !strcmp( oi->alias, vg_audio.device_choice.buffer ) ){
vg_settings.temp_audio_choice = oi->value;
break;
}