Changeset 40719 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Mar 30, 2012 9:16:35 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/noaudio.c
r39875 r40719 58 58 ticks_per_second = audio_get_ticks_per_sec (); 59 59 /* Minimize the rounding error: samples = int((ticks * freq) / ticks_per_second + 0.5). */ 60 samples = (2 * ticks * hw->info.freq + ticks_per_second) / ticks_per_second / 2; 60 samples = (int)((2 * ticks * hw->info.freq + ticks_per_second) / ticks_per_second / 2); 61 /* Usually there is no integer overflow while calculating the 'samples' value. 62 * It can happen because this is the first invocation or because the function was not called for awhile. 63 * In this case simply claim that all samples has been played. 64 */ 65 if (samples < 0) { 66 samples = live; 67 } 61 68 62 69 no->old_ticks = now;
Note:
See TracChangeset
for help on using the changeset viewer.