Changeset 5063 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Sep 26, 2007 6:03:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/audio.c
r5050 r5063 1556 1556 for (i = 0; i < sizeof (drvtab) / sizeof (drvtab[0]); i++) { 1557 1557 /* The ALSA entry can be null if we couldn't load the library */ 1558 if (drvtab[i] != NULL) 1559 { 1558 if (drvtab[i] != NULL) { 1560 1559 if (!strcmp (drvname, drvtab[i]->name)) { 1561 1560 done = !audio_driver_init (s, drvtab[i]); … … 1573 1572 if (!done) { 1574 1573 for (i = 0; !done && i < sizeof (drvtab) / sizeof (drvtab[0]); i++) { 1575 if (drvtab[i]->can_be_default) { 1576 LogRel(("Audio: Initialization of driver '%s' failed, trying '%s'.\n", 1577 drvname, drvtab[i]->name)); 1578 drvname = drvtab[i]->name; 1579 done = !audio_driver_init (s, drvtab[i]); 1574 if (drvtab[i] != NULL) { 1575 if (drvtab[i]->can_be_default) { 1576 LogRel(("Audio: Initialization of driver '%s' failed, trying '%s'.\n", 1577 drvname, drvtab[i]->name)); 1578 drvname = drvtab[i]->name; 1579 done = !audio_driver_init (s, drvtab[i]); 1580 } 1580 1581 } 1581 1582 } … … 1879 1880 LogFlow(("drvAUDIOConstruct:\n")); 1880 1881 /* 1881 * Load the ALSA driver if needed1882 */1883 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_ALSA)1884 Log2(("Loading ALSA library %s\n", VBOX_LIB_ALSA));1885 rc = (RTLdrLoad(VBOX_LIB_ALSA, &hLibVBoxAlsa));1886 if (RT_FAILURE(rc))1887 {1888 Log(("Failed to load ALSA library %s. Reason: %Rrc\n", VBOX_LIB_ALSA, rc));1889 }1890 else1891 {1892 rc = RTLdrGetSymbol(hLibVBoxAlsa, "alsa_audio_driver", (void **) &drvtab[1]);1893 if (RT_FAILURE(rc))1894 {1895 Log(("Failed to get symbol \"alsa_audio_driver\" from library %s. Reason: %Rrc\n",1896 VBOX_LIB_ALSA, rc));1897 drvtab[1] = NULL;1898 }1899 }1900 #endif1901 /*1902 1882 * Validate the config. 1903 1883 */ … … 1919 1899 if (VBOX_FAILURE (rc)) 1920 1900 return rc; 1901 1902 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_ALSA) 1903 /* 1904 * Load the ALSA driver if needed. This is a hack to remove the 1905 * hard dependency on libasound.so. 1906 */ 1907 if (0 == strcmp(drvname, "alsa")) { 1908 Log2(("Loading ALSA library %s\n", VBOX_LIB_ALSA)); 1909 rc = (RTLdrLoad(VBOX_LIB_ALSA, &hLibVBoxAlsa)); 1910 if (RT_FAILURE(rc)) { 1911 Log(("Failed to load ALSA library %s. Reason: %Rrc\n", VBOX_LIB_ALSA, rc)); 1912 } else { 1913 rc = RTLdrGetSymbol(hLibVBoxAlsa, "alsa_audio_driver", (void **) &drvtab[1]); 1914 if (RT_FAILURE(rc)) { 1915 Log(("Failed to get symbol \"alsa_audio_driver\" from library %s. Reason: %Rrc\n", 1916 VBOX_LIB_ALSA, rc)); 1917 drvtab[1] = NULL; 1918 } 1919 } 1920 } 1921 #endif 1921 1922 1922 1923 rc = AUD_init (pDrvIns, drvname);
Note:
See TracChangeset
for help on using the changeset viewer.