summaryrefslogtreecommitdiff
path: root/src/music
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-07-04 21:40:42 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-07-04 22:27:34 +0200
commit9839ce006c5f5ac1dce0d4a1aab3aef790ffbc69 (patch)
tree6dd57e15060d2e6ff63c1caf1a70f6e0b0f05afd /src/music
parentf8633fc63b453b7645d163a06e703d2a517cd8fb (diff)
downloadopenttd-9839ce006c5f5ac1dce0d4a1aab3aef790ffbc69.tar.xz
Fix: Time values should be DWORD everywhere in win32_m
Diffstat (limited to 'src/music')
-rw-r--r--src/music/win32_m.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/music/win32_m.cpp b/src/music/win32_m.cpp
index dced0f9d1..abc0fcd72 100644
--- a/src/music/win32_m.cpp
+++ b/src/music/win32_m.cpp
@@ -43,7 +43,7 @@ static struct {
MidiFile current_file; ///< file currently being played from
PlaybackSegment current_segment; ///< segment info for current playback
- size_t playback_start_time; ///< timestamp current file began playback
+ DWORD playback_start_time; ///< timestamp current file began playback
size_t current_block; ///< next block index to send
MidiFile next_file; ///< upcoming file to play
PlaybackSegment next_segment; ///< segment info for upcoming file
@@ -199,7 +199,7 @@ void CALLBACK TimerCallback(UINT uTimerID, UINT, DWORD_PTR dwUser, DWORD_PTR, DW
* The delay compensation is needed to avoid time-compression of following messages.
*/
DEBUG(driver, 2, "Win32-MIDI: timer: start from block %d (ticktime %d, realtime %.3f, bytes %d)", (int)bl, (int)block.ticktime, ((int)block.realtime) / 1000.0, (int)preload_bytes);
- _midi.playback_start_time -= block.realtime / 1000 - preload_bytes * 1000 / 3125;
+ _midi.playback_start_time -= block.realtime / 1000 - (DWORD)(preload_bytes * 1000 / 3125);
break;
}
}
@@ -209,7 +209,7 @@ void CALLBACK TimerCallback(UINT uTimerID, UINT, DWORD_PTR dwUser, DWORD_PTR, DW
/* play pending blocks */
DWORD current_time = timeGetTime();
- size_t playback_time = current_time - _midi.playback_start_time;
+ DWORD playback_time = current_time - _midi.playback_start_time;
while (_midi.current_block < _midi.current_file.blocks.size()) {
MidiFile::DataBlock &block = _midi.current_file.blocks[_midi.current_block];