From 19a6424e4fca0372de8330141100ce4c234c6670 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 25 Aug 2021 16:23:45 +0300 Subject: Audio init errors should not be fatal IssueID #325 --- src/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index b1850283..efe96ad9 100644 --- a/src/main.c +++ b/src/main.c @@ -68,10 +68,13 @@ int main(int argc, char **argv) { "DHE-RSA-AES256-GCM-SHA384"); SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1"); - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) { - fprintf(stderr, "SDL init failed: %s\n", SDL_GetError()); + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER)) { + fprintf(stderr, "[SDL] init failed: %s\n", SDL_GetError()); return -1; } + if (SDL_Init(SDL_INIT_AUDIO)) { + fprintf(stderr, "[SDL] audio init failed: %s\n", SDL_GetError()); + } run_App(argc, argv); SDL_Quit(); #if defined (LAGRANGE_ENABLE_MPG123) -- cgit v1.2.3