Changeset 68919 in vbox
- Timestamp:
- Sep 28, 2017 8:57:08 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 118183
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r68468 r68919 73 73 static const char e3[] = "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992."; 74 74 75 typedef struct SB16OUTPUTSTREAM 76 { 77 /** PCM output stream. */ 75 /** 76 * Structure defining a (host backend) driver stream. 77 * Each driver has its own instances of audio mixer streams, which then 78 * can go into the same (or even different) audio mixer sinks. 79 */ 80 typedef struct SB16DRIVERSTREAM 81 { 82 /** Associated PDM audio stream. */ 78 83 R3PTRTYPE(PPDMAUDIOSTREAM) pStream; 79 } SB16OUTPUTSTREAM, *PSB16OUTPUTSTREAM; 84 /** The stream's current configuration. */ 85 } SB16DRIVERSTREAM, *PSB16DRIVERSTREAM; 80 86 81 87 /** … … 102 108 R3PTRTYPE(PPDMIAUDIOCONNECTOR) pConnector; 103 109 /** Stream for output. */ 104 SB16 OUTPUTSTREAM Out;110 SB16DRIVERSTREAM Out; 105 111 } SB16DRIVER, *PSB16DRIVER; 112 113 /** 114 * Structure for a SB16 stream. 115 */ 116 typedef struct SB16STREAM 117 { 118 /** The stream's current configuration. */ 119 PDMAUDIOSTREAMCFG Cfg; 120 } SB16STREAM, *PSB16STREAM; 106 121 107 122 typedef struct SB16STATE … … 183 198 /** The base interface for LUN\#0. */ 184 199 PDMIBASE IBase; 200 /** Output stream. */ 201 SB16STREAM Out; 185 202 186 203 /* mixer state */ … … 189 206 } SB16STATE, *PSB16STATE; 190 207 208 static int sb16CreateDrvStream(PSB16STATE pThis, PPDMAUDIOSTREAMCFG pCfg, PSB16DRIVER pDrv); 209 static void sb16DestroyDrvStream(PSB16STATE pThis, PSB16DRIVER pDrv); 191 210 static int sb16OpenOut(PSB16STATE pThis, PPDMAUDIOSTREAMCFG pCfg); 192 211 static void sb16CloseOut(PSB16STATE pThis); … … 204 223 * 205 224 * @returns VBox status code. 206 * @param pDevIns The device instance. 207 * @param pDrv Driver to (re-)use for (re-)attaching to. 208 * If NULL is specified, a new driver will be created and appended 209 * to the driver list. 225 * @param pThis SB16 state. 210 226 * @param uLUN The logical unit which is being detached. 211 227 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines. 228 * @param ppDrv Attached driver instance on success. Optional. 212 229 */ 213 static int sb16AttachInternal(P PDMDEVINS pDevIns, PSB16DRIVER pDrv, unsigned uLUN, uint32_t fFlags)230 static int sb16AttachInternal(PSB16STATE pThis, unsigned uLUN, uint32_t fFlags, PSB16DRIVER *ppDrv) 214 231 { 215 232 RT_NOREF(fFlags); 216 PSB16STATE pThis = PDMINS_2_DATA(pDevIns, PSB16STATE);217 233 218 234 /* … … 224 240 225 241 PPDMIBASE pDrvBase; 226 int rc = PDMDevHlpDriverAttach(p DevIns, uLUN,242 int rc = PDMDevHlpDriverAttach(pThis->pDevInsR3, uLUN, 227 243 &pThis->IBase, &pDrvBase, pszDesc); 228 244 if (RT_SUCCESS(rc)) 229 245 { 230 if (pDrv == NULL) 231 pDrv = (PSB16DRIVER)RTMemAllocZ(sizeof(SB16DRIVER)); 246 PSB16DRIVER pDrv = (PSB16DRIVER)RTMemAllocZ(sizeof(SB16DRIVER)); 232 247 if (pDrv) 233 248 { … … 253 268 pDrv->fAttached = true; 254 269 } 270 271 if (ppDrv) 272 *ppDrv = pDrv; 255 273 } 256 274 else … … 258 276 } 259 277 else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) 260 {261 278 LogFunc(("No attached driver for LUN #%u\n", uLUN)); 262 }263 else if (RT_FAILURE(rc))264 AssertMsgFailed(("Failed to attach SB16 LUN #%u (\"%s\"), rc=%Rrc\n",265 uLUN, pszDesc, rc));266 279 267 280 if (RT_FAILURE(rc)) … … 277 290 278 291 /** 279 * Attach command.292 * Detach command, internal version. 280 293 * 281 * This is called to let the device attach to a driver for a specified LUN 282 * during runtime. This is not called during VM construction, the device 283 * constructor has to attach to all the available drivers. 294 * This is called to let the device detach from a driver for a specified LUN 295 * during runtime. 284 296 * 285 297 * @returns VBox status code. 286 * @param p DevIns The device instance.287 * @param uLUN The logical unit which is being detached.298 * @param pThis SB16 state. 299 * @param pDrv Driver to detach device from. 288 300 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines. 289 301 */ 302 static int sb16DetachInternal(PSB16STATE pThis, PSB16DRIVER pDrv, uint32_t fFlags) 303 { 304 RT_NOREF(fFlags); 305 306 sb16DestroyDrvStream(pThis, pDrv); 307 308 RTListNodeRemove(&pDrv->Node); 309 310 LogFunc(("uLUN=%u, fFlags=0x%x\n", pDrv->uLUN, fFlags)); 311 return VINF_SUCCESS; 312 } 313 314 /** 315 * @interface_method_impl{PDMDEVREG,pfnAttach} 316 */ 290 317 static DECLCALLBACK(int) sb16Attach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags) 291 318 { 292 return sb16AttachInternal(pDevIns, NULL /* pDrv */, uLUN, fFlags); 293 } 294 319 PSB16STATE pThis = PDMINS_2_DATA(pDevIns, PSB16STATE); 320 321 LogFunc(("uLUN=%u, fFlags=0x%x\n", uLUN, fFlags)); 322 323 PSB16DRIVER pDrv; 324 int rc2 = sb16AttachInternal(pThis, uLUN, fFlags, &pDrv); 325 if (RT_SUCCESS(rc2)) 326 rc2 = sb16CreateDrvStream(pThis, &pThis->Out.Cfg, pDrv); 327 328 return VINF_SUCCESS; 329 } 330 331 /** 332 * @interface_method_impl{PDMDEVREG,pfnDetach} 333 */ 295 334 static DECLCALLBACK(void) sb16Detach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags) 296 335 { 297 RT_NOREF(pDevIns, uLUN, fFlags); 298 LogFunc(("iLUN=%u, fFlags=0x%x\n", uLUN, fFlags)); 336 PSB16STATE pThis = PDMINS_2_DATA(pDevIns, PSB16STATE); 337 338 LogFunc(("uLUN=%u, fFlags=0x%x\n", uLUN, fFlags)); 339 340 PSB16DRIVER pDrv, pDrvNext; 341 RTListForEachSafe(&pThis->lstDrv, pDrv, pDrvNext, SB16DRIVER, Node) 342 { 343 if (pDrv->uLUN == uLUN) 344 { 345 int rc2 = sb16DetachInternal(pThis, pDrv, fFlags); 346 if (RT_SUCCESS(rc2)) 347 { 348 RTMemFree(pDrv); 349 pDrv = NULL; 350 } 351 352 break; 353 } 354 } 299 355 } 300 356 301 357 /** 302 * Re-attach .358 * Re-attaches (replaces) a driver with a new driver. 303 359 * 304 360 * @returns VBox status code. … … 308 364 * to the driver list. 309 365 * @param uLUN The logical unit which is being re-detached. 310 * @param pszDriver Driver name.366 * @param pszDriver New driver name to attach. 311 367 */ 312 368 static int sb16Reattach(PSB16STATE pThis, PSB16DRIVER pDrv, uint8_t uLUN, const char *pszDriver) … … 314 370 AssertPtrReturn(pThis, VERR_INVALID_POINTER); 315 371 AssertPtrReturn(pszDriver, VERR_INVALID_POINTER); 372 373 int rc; 374 375 if (pDrv) 376 { 377 rc = sb16DetachInternal(pThis, pDrv, 0 /* fFlags */); 378 if (RT_SUCCESS(rc)) 379 rc = PDMDevHlpDriverDetach(pThis->pDevInsR3, PDMIBASE_2_PDMDRV(pDrv->pDrvBase), 0 /* fFlags */); 380 381 if (RT_FAILURE(rc)) 382 return rc; 383 384 pDrv = NULL; 385 } 316 386 317 387 PVM pVM = PDMDevHlpGetVM(pThis->pDevInsR3); … … 325 395 { 326 396 /* Re-use the driver instance so detach it before. */ 327 intrc = PDMDevHlpDriverDetach(pThis->pDevInsR3, PDMIBASE_2_PDMDRV(pDrv->pDrvBase), 0 /* fFlags */);397 rc = PDMDevHlpDriverDetach(pThis->pDevInsR3, PDMIBASE_2_PDMDRV(pDrv->pDrvBase), 0 /* fFlags */); 328 398 if (RT_FAILURE(rc)) 329 399 return rc; … … 332 402 #define RC_CHECK() if (RT_FAILURE(rc)) { AssertReleaseRC(rc); break; } 333 403 334 int rc = VINF_SUCCESS;335 404 do 336 405 { … … 350 419 351 420 if (RT_SUCCESS(rc)) 352 rc = sb16AttachInternal(pThis ->pDevInsR3, pDrv, uLUN, 0 /* fFlags*/);421 rc = sb16AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */); 353 422 354 423 LogFunc(("pThis=%p, uLUN=%u, pszDriver=%s, rc=%Rrc\n", pThis, uLUN, pszDriver, rc)); … … 477 546 if (pThis->freq > 0) 478 547 { 479 PDMAUDIOSTREAMCFG streamCfg; 480 RT_ZERO(streamCfg); 481 482 streamCfg.enmDir = PDMAUDIODIR_OUT; 483 streamCfg.DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 484 streamCfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 485 486 streamCfg.Props.uHz = pThis->freq; 487 streamCfg.Props.cChannels = 1 << pThis->fmt_stereo; 488 streamCfg.Props.cBits = pThis->fmt_bits; 489 streamCfg.Props.fSigned = RT_BOOL(pThis->fmt_signed); 490 streamCfg.Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(streamCfg.Props.cBits, streamCfg.Props.cChannels); 491 492 int rc = sb16OpenOut(pThis, &streamCfg); 548 /* At the moment we only have one stream, the output stream. */ 549 PPDMAUDIOSTREAMCFG pCfg = &pThis->Out.Cfg; 550 551 pCfg->enmDir = PDMAUDIODIR_OUT; 552 pCfg->DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 553 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 554 555 pCfg->Props.uHz = pThis->freq; 556 pCfg->Props.cChannels = 1 << pThis->fmt_stereo; 557 pCfg->Props.cBits = pThis->fmt_bits; 558 pCfg->Props.fSigned = RT_BOOL(pThis->fmt_signed); 559 pCfg->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels); 560 561 RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output"); 562 563 sb16CloseOut(pThis); 564 565 int rc = sb16OpenOut(pThis, pCfg); 493 566 AssertRC(rc); 494 567 } … … 619 692 if (pThis->freq) 620 693 { 621 PDMAUDIOSTREAMCFG streamCfg; 622 RT_ZERO(streamCfg); 623 624 streamCfg.enmDir = PDMAUDIODIR_OUT; 625 streamCfg.DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 626 streamCfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 627 628 streamCfg.Props.uHz = pThis->freq; 629 streamCfg.Props.cChannels = 1 << pThis->fmt_stereo; 630 streamCfg.Props.cBits = pThis->fmt_bits; 631 streamCfg.Props.fSigned = RT_BOOL(pThis->fmt_signed); 632 streamCfg.Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(streamCfg.Props.cBits, streamCfg.Props.cChannels); 633 634 int rc = sb16OpenOut(pThis, &streamCfg); 694 /* At the moment we only have one stream, the output stream. */ 695 PPDMAUDIOSTREAMCFG pCfg = &pThis->Out.Cfg; 696 697 pCfg->enmDir = PDMAUDIODIR_OUT; 698 pCfg->DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 699 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 700 701 pCfg->Props.uHz = pThis->freq; 702 pCfg->Props.cChannels = 1 << pThis->fmt_stereo; 703 pCfg->Props.cBits = pThis->fmt_bits; 704 pCfg->Props.fSigned = RT_BOOL(pThis->fmt_signed); 705 pCfg->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels); 706 707 RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output"); 708 709 sb16CloseOut(pThis); 710 711 int rc = sb16OpenOut(pThis, pCfg); 635 712 AssertRC(rc); 636 713 } … … 1156 1233 pThis->fmt_stereo = 0; 1157 1234 1158 PDMAUDIOSTREAMCFG streamCfg; 1159 RT_ZERO(streamCfg); 1160 1161 streamCfg.enmDir = PDMAUDIODIR_OUT; 1162 streamCfg.DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 1163 streamCfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 1164 1165 streamCfg.Props.uHz = pThis->freq; 1166 streamCfg.Props.cChannels = 1; /* Mono */ 1167 streamCfg.Props.cBits = 8; 1168 streamCfg.Props.fSigned = false; 1169 streamCfg.Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(streamCfg.Props.cBits, streamCfg.Props.cChannels); 1170 1171 int rc2 = sb16OpenOut(pThis, &streamCfg); 1235 /* At the moment we only have one stream, the output stream. */ 1236 PPDMAUDIOSTREAMCFG pCfg = &pThis->Out.Cfg; 1237 1238 pCfg->enmDir = PDMAUDIODIR_OUT; 1239 pCfg->DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 1240 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 1241 1242 pCfg->Props.uHz = pThis->freq; 1243 pCfg->Props.cChannels = 1; /* Mono */ 1244 pCfg->Props.cBits = 8; 1245 pCfg->Props.fSigned = false; 1246 pCfg->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels); 1247 1248 RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output"); 1249 1250 sb16CloseOut(pThis); 1251 1252 int rc2 = sb16OpenOut(pThis, pCfg); 1172 1253 AssertRC(rc2); 1173 1254 } … … 2053 2134 if (pThis->freq) 2054 2135 { 2055 PDMAUDIOSTREAMCFG streamCfg; 2056 RT_ZERO(streamCfg); 2057 2058 streamCfg.enmDir = PDMAUDIODIR_OUT; 2059 streamCfg.DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 2060 streamCfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 2061 2062 streamCfg.Props.uHz = pThis->freq; 2063 streamCfg.Props.cChannels = 1 << pThis->fmt_stereo; 2064 streamCfg.Props.cBits = pThis->fmt_bits; 2065 streamCfg.Props.fSigned = RT_BOOL(pThis->fmt_signed); 2066 streamCfg.Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(streamCfg.Props.cBits, streamCfg.Props.cChannels); 2067 2068 int rc = sb16OpenOut(pThis, &streamCfg); 2136 /* At the moment we only have one stream, the output stream. */ 2137 PPDMAUDIOSTREAMCFG pCfg = &pThis->Out.Cfg; 2138 2139 pCfg->enmDir = PDMAUDIODIR_OUT; 2140 pCfg->DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 2141 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 2142 2143 pCfg->Props.uHz = pThis->freq; 2144 pCfg->Props.cChannels = 1 << pThis->fmt_stereo; 2145 pCfg->Props.cBits = pThis->fmt_bits; 2146 pCfg->Props.fSigned = RT_BOOL(pThis->fmt_signed); 2147 pCfg->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels); 2148 2149 RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "Output"); 2150 2151 sb16CloseOut(pThis); 2152 2153 int rc = sb16OpenOut(pThis, pCfg); 2069 2154 AssertRC(rc); 2070 2155 } … … 2148 2233 } 2149 2234 2235 /** 2236 * Creates a PDM audio stream for a specific driver. 2237 * 2238 * @returns IPRT status code. 2239 * @param pThis SB16 state. 2240 * @param pCfg Stream configuration to use. 2241 * @param pDrv Driver stream to create PDM stream for. 2242 */ 2243 static int sb16CreateDrvStream(PSB16STATE pThis, PPDMAUDIOSTREAMCFG pCfg, PSB16DRIVER pDrv) 2244 { 2245 RT_NOREF(pThis); 2246 2247 AssertReturn(pCfg->enmDir == PDMAUDIODIR_OUT, VERR_INVALID_PARAMETER); 2248 Assert(DrvAudioHlpStreamCfgIsValid(pCfg)); 2249 2250 PPDMAUDIOSTREAMCFG pCfgHost = DrvAudioHlpStreamCfgDup(pCfg); 2251 if (!pCfgHost) 2252 return VERR_NO_MEMORY; 2253 2254 if (!RTStrPrintf(pCfgHost->szName, sizeof(pCfgHost->szName), "%s", pCfg->szName)) 2255 { 2256 RTMemFree(pCfgHost); 2257 return VERR_BUFFER_OVERFLOW; 2258 } 2259 2260 LogFunc(("[LUN#%RU8] %s\n", pDrv->uLUN, pCfgHost->szName)); 2261 2262 AssertMsg(pDrv->Out.pStream == NULL, ("[LUN#%RU8] Driver stream already present when it must not\n", pDrv->uLUN)); 2263 2264 int rc = pDrv->pConnector->pfnStreamCreate(pDrv->pConnector, pCfgHost, pCfg /* pCfgGuest */, &pDrv->Out.pStream); 2265 if (RT_SUCCESS(rc)) 2266 { 2267 pDrv->pConnector->pfnStreamRetain(pDrv->pConnector, pDrv->Out.pStream); 2268 LogFlowFunc(("LUN#%RU8: Created output \"%s\", rc=%Rrc\n", pDrv->uLUN, pCfg->szName, rc)); 2269 } 2270 2271 if (pCfgHost) 2272 { 2273 RTMemFree(pCfgHost); 2274 pCfgHost = NULL; 2275 } 2276 2277 return rc; 2278 } 2279 2280 /** 2281 * Destroys a PDM audio stream of a specific driver. 2282 * 2283 * @param pThis SB16 state. 2284 * @param pDrv Driver stream to destroy PDM stream for. 2285 */ 2286 static void sb16DestroyDrvStream(PSB16STATE pThis, PSB16DRIVER pDrv) 2287 { 2288 AssertPtrReturnVoid(pThis); 2289 AssertPtrReturnVoid(pDrv); 2290 2291 if (pDrv->Out.pStream) 2292 { 2293 pDrv->pConnector->pfnStreamRelease(pDrv->pConnector, pDrv->Out.pStream); 2294 2295 int rc2 = pDrv->pConnector->pfnStreamDestroy(pDrv->pConnector, pDrv->Out.pStream); 2296 if (RT_SUCCESS(rc2)) 2297 pDrv->Out.pStream = NULL; 2298 } 2299 } 2300 2150 2301 static int sb16OpenOut(PSB16STATE pThis, PPDMAUDIOSTREAMCFG pCfg) 2151 2302 { … … 2155 2306 LogFlowFuncEnter(); 2156 2307 2157 AssertReturn(pCfg->enmDir == PDMAUDIODIR_OUT, VERR_INVALID_PARAMETER); 2158 Assert(DrvAudioHlpStreamCfgIsValid(pCfg)); 2159 2160 /* Set a default audio format for the host. */ 2161 PDMAUDIOSTREAMCFG CfgHost; 2162 RT_ZERO(CfgHost); 2163 2164 CfgHost.enmDir = PDMAUDIODIR_OUT; 2165 CfgHost.DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; 2166 CfgHost.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 2167 2168 CfgHost.Props.uHz = pCfg->Props.uHz; 2169 CfgHost.Props.cChannels = pCfg->Props.cChannels; 2170 CfgHost.Props.cBits = pCfg->Props.cBits; 2171 CfgHost.Props.fSigned = pCfg->Props.fSigned; 2172 CfgHost.Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(CfgHost.Props.cBits, CfgHost.Props.cChannels); 2173 2174 RTStrPrintf(CfgHost.szName, sizeof(CfgHost.szName), "Output"); 2175 2176 uint8_t uLUN = 0; 2308 if (!DrvAudioHlpStreamCfgIsValid(pCfg)) 2309 return VERR_INVALID_PARAMETER; 2177 2310 2178 2311 int rc = VINF_SUCCESS; … … 2181 2314 RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node) 2182 2315 { 2183 if (!RTStrPrintf(pCfg->szName, sizeof(pCfg->szName), "%s", CfgHost.szName)) 2184 { 2185 rc = VERR_BUFFER_OVERFLOW; 2186 break; 2187 } 2188 2189 int rc2; 2190 2191 if (pDrv->Out.pStream) 2192 { 2193 pDrv->pConnector->pfnStreamRelease(pDrv->pConnector, pDrv->Out.pStream); 2194 2195 rc2 = pDrv->pConnector->pfnStreamDestroy(pDrv->pConnector, pDrv->Out.pStream); 2196 if (RT_SUCCESS(rc2)) 2197 pDrv->Out.pStream = NULL; 2198 } 2199 else 2200 rc2 = VINF_SUCCESS; 2201 2202 if (RT_SUCCESS(rc2)) 2203 { 2204 rc2 = pDrv->pConnector->pfnStreamCreate(pDrv->pConnector, &CfgHost, pCfg, &pDrv->Out.pStream); 2205 if (RT_SUCCESS(rc2)) 2206 pDrv->pConnector->pfnStreamRetain(pDrv->pConnector, pDrv->Out.pStream); 2207 } 2208 2209 LogFlowFunc(("LUN#%RU8: Created output \"%s\", rc=%Rrc\n", pDrv->uLUN, pCfg->szName, rc2)); 2210 2211 uLUN++; 2316 int rc2 = sb16CreateDrvStream(pThis, pCfg, pDrv); 2317 if (RT_SUCCESS(rc)) 2318 rc = rc2; 2212 2319 } 2213 2320 … … 2224 2331 PSB16DRIVER pDrv; 2225 2332 RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node) 2226 { 2227 int rc2 = pDrv->pConnector->pfnStreamControl(pDrv->pConnector, pDrv->Out.pStream, PDMAUDIOSTREAMCMD_DISABLE); 2228 AssertRC(rc2); 2229 } 2333 sb16DestroyDrvStream(pThis, pDrv); 2230 2334 2231 2335 LogFlowFuncLeave(); … … 2445 2549 { 2446 2550 LogFunc(("Trying to attach driver for LUN #%RU8 ...\n", uLUN)); 2447 rc = sb16AttachInternal(p DevIns, NULL /* pDrv */, uLUN, 0 /* fFlags*/);2551 rc = sb16AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */); 2448 2552 if (RT_FAILURE(rc)) 2449 2553 {
Note:
See TracChangeset
for help on using the changeset viewer.