Changeset 53523 in vbox for trunk/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
- Timestamp:
- Dec 12, 2014 1:46:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
r53511 r53523 68 68 { 69 69 /** Note: Always must come first! */ 70 PDMAUDIOHSTSTRMIN hw;70 PDMAUDIOHSTSTRMIN pStreamIn; 71 71 int hFile; 72 72 int cFragments; … … 79 79 { 80 80 /** Note: Always must come first! */ 81 PDMAUDIOHSTSTRMOUT hw;81 PDMAUDIOHSTSTRMOUT pStreamOut; 82 82 int hFile; 83 83 int cFragments; … … 204 204 } 205 205 206 static void drvHostOSSAudioClose(int *phFile) 207 { 208 if (!phFile) 209 return; 210 211 if (*phFile) 212 { 213 if (close(*phFile)) 214 LogRel(("Audio: Closing descriptor failed: %s\n", 215 strerror(errno))); 216 else 217 *phFile = -1; 206 static int drvHostOSSAudioClose(int *phFile) 207 { 208 if (!phFile || !*phFile) 209 return VINF_SUCCESS; 210 211 int rc; 212 if (close(*phFile)) 213 { 214 LogRel(("Audio: Closing descriptor failed: %s\n", 215 strerror(errno))); 216 rc = VERR_GENERAL_FAILURE; /** @todo */ 218 217 } 218 else 219 { 220 *phFile = -1; 221 rc = VINF_SUCCESS; 222 } 223 224 return rc; 219 225 } 220 226 … … 232 238 do 233 239 { 234 const char *pszD SP= fIn ? s_OSSConf.devpath_in : s_OSSConf.devpath_out;235 if (!pszD SP)236 { 237 LogRel(("Audio: Invalid or no %s DSPset\n",240 const char *pszDev = fIn ? s_OSSConf.devpath_in : s_OSSConf.devpath_out; 241 if (!pszDev) 242 { 243 LogRel(("Audio: Invalid or no %s device name set\n", 238 244 fIn ? "input" : "output")); 239 245 rc = VERR_INVALID_PARAMETER; … … 241 247 } 242 248 243 hFile = open(pszD SP, (fIn ? O_RDONLY : O_WRONLY) | O_NONBLOCK);244 if ( !hFile)245 { 246 LogRel(("Audio: Failed to open %s: %s\n", pszD SP, strerror(errno)));249 hFile = open(pszDev, (fIn ? O_RDONLY : O_WRONLY) | O_NONBLOCK); 250 if (hFile == -1) 251 { 252 LogRel(("Audio: Failed to open %s: %s\n", pszDev, strerror(errno))); 247 253 rc = RTErrConvertFromErrno(errno); 248 254 break;
Note:
See TracChangeset
for help on using the changeset viewer.