Changeset 59421 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jan 20, 2016 2:56:07 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 105143
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r59263 r59421 538 538 DSBUFFERDESC bd; 539 539 RT_ZERO(bd); 540 bd.dwSize = sizeof(bd);540 bd.dwSize = sizeof(bd); 541 541 bd.lpwfxFormat = &wfx; 542 bd.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2; 542 543 /* 544 * As we reuse our (secondary) buffer for playing out data as it comes in, 545 * we're using this buffer as a so-called static buffer. 546 * 547 * However, as we do not want to use memory on the sound device directly 548 * (as most modern audio hardware on the host doesn't have this anyway), 549 * we're *not* going to use DSBCAPS_STATIC for that. 550 * 551 * Instead we're specifying DSBCAPS_LOCSOFTWARE, as this fits the bill 552 * of copying own buffer data (from AudioMixBuf) to our secondary's Direct Sound buffer. 553 */ 554 bd.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCSOFTWARE; 543 555 #ifdef VBOX_WITH_AUDIO_CALLBACKS 544 bd.dwFlags 556 bd.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY; 545 557 #endif 546 558 bd.dwBufferBytes = pThis->cfg.cbBufferOut; … … 584 596 DSLOG(("DSound: Playback format:\n" 585 597 " dwBufferBytes = %RI32\n" 598 " dwFlags = 0x%x\n" 586 599 " wFormatTag = %RI16\n" 587 600 " nChannels = %RI16\n" … … 592 605 " cbSize = %RI16\n", 593 606 bc.dwBufferBytes, 607 bc.dwFlags, 594 608 wfx.wFormatTag, 595 609 wfx.nChannels, … … 742 756 { 743 757 /* This performs some restore, so call it anyway and ignore result. */ 744 directSoundPlayGetStatus(pDSoundStrmOut->pDSB, NULL /* Status */); 745 746 DSLOG(("DSound: Stopping playback\n")); 747 748 /** @todo Wait until all data in the buffer has been played. */ 749 hr = IDirectSoundBuffer8_Stop(pDSoundStrmOut->pDSB); 758 hr = directSoundPlayGetStatus(pDSoundStrmOut->pDSB, NULL /* pdwStatus */); 750 759 if (SUCCEEDED(hr)) 751 dsoundPlayClearSamples(pDSoundStrmOut); 752 else 753 DSLOGREL(("DSound: Stopping playback failed with %Rhrc\n", hr)); 760 { 761 DSLOG(("DSound: Stopping playback\n")); 762 763 /** @todo Wait until all data in the buffer has been played. */ 764 hr = IDirectSoundBuffer8_Stop(pDSoundStrmOut->pDSB); 765 if (SUCCEEDED(hr)) 766 dsoundPlayClearSamples(pDSoundStrmOut); 767 } 754 768 } 755 769 else 756 770 hr = E_UNEXPECTED; 771 772 if (FAILED(hr)) 773 DSLOGREL(("DSound: Stopping playback failed with %Rhrc\n", hr)); 757 774 758 775 return hr; … … 790 807 else 791 808 hr = E_UNEXPECTED; 809 810 if (FAILED(hr)) 811 DSLOGREL(("DSound: Starting playback failed with %Rhrc\n", hr)); 792 812 793 813 return hr; … … 1007 1027 DSLOG(("DSound: Capture format:\n" 1008 1028 " dwBufferBytes = %RI32\n" 1029 " dwFlags = 0x%x\n" 1009 1030 " wFormatTag = %RI16\n" 1010 1031 " nChannels = %RI16\n" … … 1015 1036 " cbSize = %RI16\n", 1016 1037 bc.dwBufferBytes, 1038 bc.dwFlags, 1017 1039 wfx.wFormatTag, 1018 1040 wfx.nChannels, … … 1363 1385 DWORD cb1, cb2; 1364 1386 HRESULT hr = directSoundPlayLock(pDSB, &pHstStrmOut->Props, pDSoundStrmOut->cbPlayWritePos, cbLive, 1365 &pv1, &pv2, &cb1, &cb2, 0 /* dwFlags */);1387 &pv1, &pv2, &cb1, &cb2, 0 /* dwFlags */); 1366 1388 if (FAILED(hr)) 1367 1389 {
Note:
See TracChangeset
for help on using the changeset viewer.