@@ -51,7 +51,7 @@ typedef struct audio_context {
5151 size_t render_buffer_size;
5252
5353 int frame_size;
54- } oal_info ;
54+ } audio_context ;
5555
5656static audio_context Audio{};
5757
@@ -525,37 +525,6 @@ static bool ds_init_loopback(std::string &Device)
525525 return true ;
526526}
527527
528- static bool ds_init_physical (std::string &Device, const int sample_rate)
529- {
530- ALCint attrList[] = { ALC_FREQUENCY , sample_rate, 0 };
531-
532- if ( !openal_init_device (&Device, nullptr ) ) {
533- mprintf ((" \n ERROR: Unable to find suitable playback device!\n\n " ));
534- return false ;
535- }
536-
537- Audio.device = alcOpenDevice (reinterpret_cast <const ALCchar*>(Device.c_str ()));
538-
539- if (Audio.device == nullptr ) {
540- mprintf ((" Failed to open playback_device (%s) returning error (%s)\n " , Device.c_str (), openal_error_string (1 )));
541- return false ;
542- }
543-
544- Audio.context = alcCreateContext (Audio.device , attrList);
545-
546- if (Audio.context == nullptr ) {
547- mprintf ((" Failed to create context for playback_device (%s) with attrList = { 0x%x, %d, %d } returning error (%s)\n " ,
548- Device.c_str (), attrList[0 ], attrList[1 ], attrList[2 ], openal_error_string (1 )));
549- return false ;
550- }
551-
552- alcMakeContextCurrent (Audio.context );
553-
554- alcGetError (Audio.device );
555-
556- return true ;
557- }
558-
559528/* *
560529 * Sound initialisation
561530 * @return -1 if init failed, 0 if init success
@@ -595,14 +564,9 @@ int ds_init()
595564
596565 if ( !ds_init_loopback (playback_device) ) {
597566 ds_close ();
567+ mprintf ((" ... OpenAL failed to initialize!\n " ));
598568
599- if ( !ds_init_physical (playback_device, sample_rate) ) {
600- ds_close ();
601-
602- mprintf ((" ... OpenAL failed to initialize!\n " ));
603-
604- return -1 ;
605- }
569+ return -1 ;
606570 }
607571
608572 mprintf ((" OpenAL Vendor : %s\n " , alGetString (AL_VENDOR )));
0 commit comments