From d4da257ff9b11abcbaaea85743665d4188562856 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 9 Jul 2010 22:25:25 +0000 Subject: (svn r20105) -Revert (r20102) [FS#3938]: resetting DirectMusic completely, although working, causes a temporary freeze of OpenTTD. As MCI behaves better than DirectMusic that has become the default music driver; small delay between songs beats wrongly pitched/bad sounding songs --- src/music/dmusic.cpp | 4 ++-- src/music/dmusic.h | 2 +- src/music/win32_m.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp index 21eb47b44..cb255e7c0 100644 --- a/src/music/dmusic.cpp +++ b/src/music/dmusic.cpp @@ -165,8 +165,8 @@ void MusicDriver_DMusic::PlaySong(const char *filename) /* release the existing segment if we have any */ if (segment != NULL) { - this->Stop(); - if (this->Start(NULL) != NULL) return; + segment->Release(); + segment = NULL; } /* make a new segment */ diff --git a/src/music/dmusic.h b/src/music/dmusic.h index 74368de23..ed2dcabf1 100644 --- a/src/music/dmusic.h +++ b/src/music/dmusic.h @@ -32,7 +32,7 @@ public: class FMusicDriver_DMusic: public MusicDriverFactory { public: - static const int priority = 10; + static const int priority = 5; /* virtual */ const char *GetName() { return "dmusic"; } /* virtual */ const char *GetDescription() { return "DirectMusic MIDI Driver"; } /* virtual */ Driver *CreateInstance() { return new MusicDriver_DMusic(); } diff --git a/src/music/win32_m.h b/src/music/win32_m.h index d596d3a9f..2e991bd9f 100644 --- a/src/music/win32_m.h +++ b/src/music/win32_m.h @@ -32,7 +32,7 @@ public: class FMusicDriver_Win32: public MusicDriverFactory { public: - static const int priority = 5; + static const int priority = 10; /* virtual */ const char *GetName() { return "win32"; } /* virtual */ const char *GetDescription() { return "Win32 Music Driver"; } /* virtual */ Driver *CreateInstance() { return new MusicDriver_Win32(); } -- cgit v1.2.3-54-g00ecf