1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-26 11:56:16 +02:00

Initialize the timers subsystem of SDL at the beginning

This fixes a bug where disabling the backlight timeout would
prevent the clock from working correctly.
This commit is contained in:
Paul Cercueil 2013-07-22 00:20:18 -04:00
parent 47bbc0b673
commit e0109dfe55
3 changed files with 1 additions and 5 deletions

View File

@ -85,7 +85,6 @@ void Clock::addTimer(int timeout)
Clock::Clock(void) Clock::Clock(void)
{ {
SDL_InitSubSystem(SDL_INIT_TIMER);
tzset(); tzset();
int sec = update(); int sec = update();
@ -95,7 +94,6 @@ Clock::Clock(void)
Clock::~Clock() Clock::~Clock()
{ {
SDL_RemoveTimer(timer); SDL_RemoveTimer(timer);
SDL_QuitSubSystem(SDL_INIT_TIMER);
instance = NULL; instance = NULL;
} }

View File

@ -223,7 +223,7 @@ GMenu2X::GMenu2X()
setenv("SDL_FBCON_DONT_CLEAR", "1", 0); setenv("SDL_FBCON_DONT_CLEAR", "1", 0);
//Screen //Screen
if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK)<0 ) { if( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0) {
ERROR("Could not initialize SDL: %s\n", SDL_GetError()); ERROR("Could not initialize SDL: %s\n", SDL_GetError());
quit(); quit();
} }

View File

@ -36,14 +36,12 @@ bool PowerSaver::isRunning() {
} }
PowerSaver::PowerSaver() { PowerSaver::PowerSaver() {
SDL_InitSubSystem(SDL_INIT_TIMER);
setScreenTimeout(0); setScreenTimeout(0);
screenTimer = NULL; screenTimer = NULL;
} }
PowerSaver::~PowerSaver() { PowerSaver::~PowerSaver() {
SDL_RemoveTimer(screenTimer); SDL_RemoveTimer(screenTimer);
SDL_QuitSubSystem(SDL_INIT_TIMER);
instance = NULL; instance = NULL;
} }