@@ -333,7 +333,6 @@ void coreaudio_macos_microphone_free(void *data)
333333
334334static struct string_list *coreaudio_macos_microphone_device_list_new (const void *data)
335335{
336- RARCH_LOG (" [CoreAudio macOS Mic] device_list_new called.\n " );
337336 struct string_list *list = string_list_new ();
338337 if (!list)
339338 {
@@ -462,8 +461,6 @@ void coreaudio_macos_microphone_free(void *data)
462461
463462static void coreaudio_macos_microphone_device_list_free (const void *data, struct string_list *list)
464463{
465- (void )data; /* Not used in this implementation */
466- RARCH_LOG (" [CoreAudio macOS Mic] device_list_free called.\n " );
467464 if (list)
468465 {
469466 for (size_t i = 0 ; i < list->size ; i++)
@@ -818,7 +815,6 @@ static bool coreaudio_macos_microphone_mic_alive(const void *data, const void *m
818815
819816static bool coreaudio_macos_microphone_start_mic (void *data, void *mic_data)
820817{
821- RARCH_LOG (" [CoreAudio macOS Mic] start_mic called. Mic context: %p \n " , mic_data);
822818 coreaudio_macos_microphone_t *mic = (coreaudio_macos_microphone_t *)mic_data;
823819 if (!mic || !mic->audio_unit || !atomic_load (&mic->is_initialized ))
824820 {
@@ -827,10 +823,7 @@ static bool coreaudio_macos_microphone_start_mic(void *data, void *mic_data)
827823 }
828824
829825 if (atomic_load (&mic->is_running ))
830- {
831- RARCH_LOG (" [CoreAudio macOS Mic] Already running.\n " );
832826 return true ;
833- }
834827
835828 /* Check microphone permission on macOS */
836829 RARCH_LOG (" [CoreAudio macOS Mic] Checking microphone permission...\n " );
@@ -849,7 +842,7 @@ static bool coreaudio_macos_microphone_start_mic(void *data, void *mic_data)
849842 if (perm_status != noErr || default_input_device == kAudioObjectUnknown )
850843 {
851844 RARCH_ERR (" [CoreAudio macOS Mic] No default input device available or permission denied. Status: %d , Device ID: %u \n " ,
852- (int )perm_status, (unsigned )default_input_device);
845+ (int )perm_status, (unsigned )default_input_device);
853846 }
854847 else
855848 {
@@ -858,8 +851,8 @@ static bool coreaudio_macos_microphone_start_mic(void *data, void *mic_data)
858851
859852 if (!mic->fifo )
860853 {
861- RARCH_ERR (" [CoreAudio macOS Mic] No FIFO buffer available\n " );
862- return false ;
854+ RARCH_ERR (" [CoreAudio macOS Mic] No FIFO buffer available\n " );
855+ return false ;
863856 }
864857 slock_lock (mic->fifo_lock );
865858 fifo_clear (mic->fifo );
@@ -872,26 +865,20 @@ static bool coreaudio_macos_microphone_start_mic(void *data, void *mic_data)
872865 RARCH_LOG (" [CoreAudio macOS Mic] Microphone started successfully\n " );
873866 return true ;
874867 }
875- else
876- {
877- RARCH_ERR (" [CoreAudio macOS Mic] Failed to start AudioUnit: %d (0x%x )\n " , (int )status, (unsigned )status);
878- atomic_store (&mic->is_running , false );
879- return false ;
880- }
868+
869+ RARCH_ERR (" [CoreAudio macOS Mic] Failed to start AudioUnit: %d (0x%x )\n " , (int )status, (unsigned )status);
870+ atomic_store (&mic->is_running , false );
871+ return false ;
881872}
882873
883874static bool coreaudio_macos_microphone_stop_mic (void *data, void *mic_data)
884875{
885876 coreaudio_macos_microphone_t *mic = (coreaudio_macos_microphone_t *)mic_data;
886877 if (!mic || !mic->audio_unit )
887- {
888878 return true ; /* Considered stopped if not valid */
889- }
890879
891880 if (!atomic_load (&mic->is_running ))
892- {
893881 return true ;
894- }
895882
896883 OSStatus status = AudioOutputUnitStop (mic->audio_unit );
897884 if (status == noErr)
@@ -905,21 +892,17 @@ static bool coreaudio_macos_microphone_stop_mic(void *data, void *mic_data)
905892 }
906893 return true ;
907894 }
908- else
909- {
910- RARCH_ERR (" [CoreAudio macOS Mic] Failed to stop AudioUnit: %d \n " , (int )status);
911- /* Even if stop fails, we mark as not running from our perspective */
912- atomic_store (&mic->is_running , false );
913- return false ;
914- }
895+
896+ RARCH_ERR (" [CoreAudio macOS Mic] Failed to stop AudioUnit: %d \n " , (int )status);
897+ /* Even if stop fails, we mark as not running from our perspective */
898+ atomic_store (&mic->is_running , false );
899+ return false ;
915900}
916901
917902static bool coreaudio_macos_microphone_mic_use_float (const void *data, const void *mic_data)
918903{
919- (void )data;
920904 coreaudio_macos_microphone_t *mic = (coreaudio_macos_microphone_t *)mic_data;
921- bool result = mic && mic->use_float ;
922- return result;
905+ return mic && mic->use_float ;
923906}
924907
925908
0 commit comments