Changeset 73682 in vbox for trunk/src/VBox
- Timestamp:
- Aug 15, 2018 7:14:52 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r73675 r73682 875 875 #endif 876 876 877 /* Whether to discard the incoming data or not. */ 878 bool fToBitBucket = false; 879 877 880 do 878 881 { … … 884 887 } 885 888 886 if ( pThis->pHostDrvAudio 887 && pThis->pHostDrvAudio->pfnGetStatus 888 && pThis->pHostDrvAudio->pfnGetStatus(pThis->pHostDrvAudio, PDMAUDIODIR_OUT) != PDMAUDIOBACKENDSTS_RUNNING) 889 { 890 rc = VERR_AUDIO_STREAM_NOT_READY; 891 break; 889 if (pThis->pHostDrvAudio) 890 { 891 /* If the backend's stream is not writable, all written data goes to /dev/null. */ 892 if (!DrvAudioHlpStreamStatusCanWrite( 893 pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pStream->pvBackend))) 894 { 895 fToBitBucket = true; 896 break; 897 } 892 898 } 893 899 … … 978 984 if (RT_SUCCESS(rc)) 979 985 { 986 if (fToBitBucket) 987 { 988 Log3Func(("[%s] Backend stream not ready (yet), discarding written data\n", pStream->szName)); 989 cbWrittenTotal = cbBuf; /* Report all data as being written to the caller. */ 990 } 991 980 992 if (pcbWritten) 981 993 *pcbWritten = cbWrittenTotal; … … 2740 2752 { 2741 2753 /* 2742 * If Nothing is readable, check if the stream on the backend side is ready to be read from.2754 * If nothing is readable, check if the stream on the backend side is ready to be read from. 2743 2755 * If it isn't, return the number of bytes readable since the last read from this stream. 2744 2756 * … … 2748 2760 */ 2749 2761 if (!DrvAudioHlpStreamStatusCanRead( 2750 2762 pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pStream->pvBackend))) 2751 2763 { 2752 2764 cbReadable = DrvAudioHlpNanoToBytes(RTTimeNanoTS() - pStream->tsLastReadWrittenNs, … … 2760 2772 } 2761 2773 2762 2763 2774 Log3Func(("[%s] cbReadable=%RU32 (%RU64ms)\n", 2775 pStream->szName, cbReadable, DrvAudioHlpBytesToMilli(cbReadable, &pStream->Host.Cfg.Props))); 2764 2776 2765 2777 rc2 = RTCritSectLeave(&pThis->CritSect); … … 2787 2799 uint32_t cbWritable = 0; 2788 2800 2801 /* Note: We don't propage the backend stream's status to the outside -- it's the job of this 2802 * audio connector to make sense of it. */ 2789 2803 if (DrvAudioHlpStreamStatusCanWrite(pStream->fStatus)) 2790 2804 { … … 2795 2809 } 2796 2810 2797 Log3Func(("[%s] cbWritable=%RU32 (%RU64ms 2)\n",2811 Log3Func(("[%s] cbWritable=%RU32 (%RU64ms)\n", 2798 2812 pStream->szName, cbWritable, DrvAudioHlpBytesToMilli(cbWritable, &pStream->Host.Cfg.Props))); 2799 2813
Note:
See TracChangeset
for help on using the changeset viewer.