Changeset 54336 in vbox
- Timestamp:
- Feb 20, 2015 5:02:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/dsoundaudio.c
r53417 r54336 755 755 DSCBUFFERDESC bd; 756 756 DSCBCAPS bc; 757 DWORD cpos;757 DWORD rpos; 758 758 759 759 DSLOGF(("DSound: capture open %p size %d samples, freq %d, chan %d, bits %d, sign %d\n", … … 796 796 /* Query the actual parameters. */ 797 797 798 hr = IDirectSoundCaptureBuffer_GetCurrentPosition (ds->dsound_capture_buffer, &cpos, NULL);798 hr = IDirectSoundCaptureBuffer_GetCurrentPosition (ds->dsound_capture_buffer, NULL, &rpos); 799 799 if (FAILED (hr)) { 800 cpos = 0;800 rpos = 0; 801 801 DSLOGF(("DSound: open GetCurrentPosition %Rhrc\n", hr)); 802 802 } … … 846 846 /* Initial state: reading at the initial capture position. */ 847 847 ds->hw.wpos = 0; 848 ds->last_read_pos = cpos >> ds->hw.info.shift;848 ds->last_read_pos = rpos >> ds->hw.info.shift; 849 849 ds->capture_buffer_size = bc.dwBufferBytes >> ds->hw.info.shift; 850 850 DSLOGF(("DSound: capture open last_read_pos %d, capture_buffer_size %d\n", ds->last_read_pos, ds->capture_buffer_size)); … … 1156 1156 int len1, len2; 1157 1157 int decr; 1158 DWORD cpos;1158 DWORD rpos; 1159 1159 LPVOID p1, p2; 1160 1160 int hwshift; … … 1175 1175 hr = IDirectSoundCaptureBuffer_GetCurrentPosition ( 1176 1176 dscb, 1177 &cpos,1178 NULL1177 NULL, 1178 &rpos 1179 1179 ); 1180 1180 if (FAILED (hr)) { … … 1187 1187 ds->hr_last_run_in = hr; 1188 1188 1189 if ( cpos & hw->info.align) {1190 DSLOGF(("DSound: run_in misaligned capture position %ld(%d)\n", cpos, hw->info.align));1191 } 1192 1193 cpos >>= hwshift;1189 if (rpos & hw->info.align) { 1190 DSLOGF(("DSound: run_in misaligned read position %ld(%d)\n", rpos, hw->info.align)); 1191 } 1192 1193 rpos >>= hwshift; 1194 1194 1195 1195 /* Number of samples available in the capture buffer. */ 1196 len = audio_ring_dist ( cpos, ds->last_read_pos, ds->capture_buffer_size);1196 len = audio_ring_dist (rpos, ds->last_read_pos, ds->capture_buffer_size); 1197 1197 if (!len) { 1198 1198 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.