[vlc-commits] [Git][videolan/vlc][master] auhal: fix a missing failure check

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Mon Jan 10 13:11:59 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
e663ebb0 by Lyndon Brown at 2022-01-10T12:51:15+00:00
auhal: fix a missing failure check

and remove a pointless stray obj-c-ism (the `nil`).

- - - - -


1 changed file:

- modules/audio_output/auhal.c


Changes:

=====================================
modules/audio_output/auhal.c
=====================================
@@ -525,11 +525,19 @@ RebuildDeviceList(audio_output_t * p_aout, UInt32 *p_id_exists)
         CFArrayAppendValue(currentListOfDevices, deviceNumber);
         CFRelease(deviceNumber);
 
+        // TODO: only register once for each device
+        ManageAudioStreamsCallback(p_aout, i_id, true);
+
         if (AudioDeviceSupportsDigital(p_aout, i_id))
         {
             msg_Dbg(p_aout, "'%s' supports digital output", psz_name);
-            char *psz_encoded_name = nil;
-            asprintf(&psz_encoded_name, _("%s (Encoded Output)"), psz_name);
+            char *psz_encoded_name;
+            if( asprintf(&psz_encoded_name, _("%s (Encoded Output)"), psz_name) == -1 )
+            {
+                free(psz_name);
+                continue;
+            }
+
             i_id = i_id | AOUT_VAR_SPDIF_FLAG;
             ReportDevice(p_aout, i_id, psz_encoded_name);
             deviceNumber = CFNumberCreate(kCFAllocatorDefault,
@@ -542,10 +550,6 @@ RebuildDeviceList(audio_output_t * p_aout, UInt32 *p_id_exists)
             if (p_id_exists && i_id == i_id_exists)
                 *p_id_exists = i_id;
         }
-
-        // TODO: only register once for each device
-        ManageAudioStreamsCallback(p_aout, p_devices[i], true);
-
         free(psz_name);
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e663ebb034288f48235d3d06b5466f4197183c81

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/e663ebb034288f48235d3d06b5466f4197183c81
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list