From 75d8dd2bf25c01c8db7c5549f0ffc4225a46723d Mon Sep 17 00:00:00 2001 From: erorcun Date: Wed, 17 Feb 2021 15:58:52 +0300 Subject: Show Radio Off on interiors that don't want radio --- src/audio/MusicManager.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/audio') diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index 4b32002b..9c6f61f6 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -1265,7 +1265,11 @@ cMusicManager::DisplayRadioStationName() if (vehicle) { - int8 track; +#if defined RADIO_SCROLL_TO_PREV_STATION || defined FIX_BUGS // Because m_nFrontendTrack can have NO_TRACK + int track; +#else + uint8 track; +#endif gStreamedSound = vehicle->m_nRadioStation; if (gStreamedSound >= STREAMED_SOUND_CITY_AMBIENT && gStreamedSound <= STREAMED_SOUND_AMBSIL_AMBIENT) gStreamedSound = RADIO_OFF; @@ -1282,11 +1286,7 @@ cMusicManager::DisplayRadioStationName() gNumRetunePresses++; } else -#ifdef FIX_BUGS - track = GetCarTuning(); // gStreamedSound or veh->m_nRadioStation would also work, but these don't cover police/taxi radios -#else track = m_nFrontendTrack; -#endif wchar* string = nil; switch (track) { @@ -1304,7 +1304,10 @@ cMusicManager::DisplayRadioStationName() return; string = TheText.Get("FEA_MP3"); break; #ifdef RADIO_OFF_TEXT - case RADIO_OFF: { + case STREAMED_SOUND_RADIO_POLICE: + case STREAMED_SOUND_RADIO_TAXI: + return; + default: { extern wchar WideErrorString[]; string = TheText.Get("FEA_NON"); @@ -1314,8 +1317,9 @@ cMusicManager::DisplayRadioStationName() } break; } -#endif +#else default: return; +#endif }; if (pCurrentStation != string) { -- cgit v1.2.3 From 691c8e77028fe293345f10d3104452f8658cf980 Mon Sep 17 00:00:00 2001 From: erorcun Date: Wed, 17 Feb 2021 15:59:05 +0300 Subject: Fix fuzzy #ifdef --- src/audio/oal/stream.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/audio') diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index e2e87f2d..ed73e940 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -464,7 +464,7 @@ public: #endif #ifdef AUDIO_OAL_USE_MPG123 -// fuzzy seek eliminates stutter when playing ADF but spams errors a lot (nothing breaks though) +// fuzzy seek eliminates stutter when playing ADF but spams errors a lot (and breaks radio sometimes) //#define MP3_USE_FUZZY_SEEK class CMP3File : public IDecoder @@ -492,6 +492,8 @@ public: { #ifdef MP3_USE_FUZZY_SEEK mpg123_param(m_pMH, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS | MPG123_QUIET, 0.0); +#else + mpg123_param(m_pMH, MPG123_FLAGS, MPG123_SEEKBUFFER | MPG123_GAPLESS, 0.0); #endif long rate = 0; int channels = 0; @@ -602,6 +604,8 @@ public: { #ifdef MP3_USE_FUZZY_SEEK mpg123_param(m_pMH, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS | MPG123_QUIET, 0.0); +#else + mpg123_param(m_pMH, MPG123_FLAGS, MPG123_SEEKBUFFER | MPG123_GAPLESS, 0.0); #endif long rate = 0; int channels = 0; -- cgit v1.2.3