Changeset 39875 in vbox
- Timestamp:
- Jan 25, 2012 3:32:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/noaudio.c
r35353 r39875 46 46 int64_t now; 47 47 int64_t ticks; 48 int64_t bytes;48 int64_t ticks_per_second; 49 49 50 50 live = audio_pcm_hw_get_live_out (&no->hw); … … 55 55 now = audio_get_clock (); 56 56 ticks = now - no->old_ticks; 57 bytes = (ticks * hw->info.bytes_per_second) / audio_get_ticks_per_sec (); 58 bytes = audio_MIN (bytes, INT_MAX); 59 samples = bytes >> hw->info.shift; 57 58 ticks_per_second = audio_get_ticks_per_sec (); 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 61 61 62 no->old_ticks = now;
Note:
See TracChangeset
for help on using the changeset viewer.