This commit is contained in:
Romain Vimont
2025-10-07 20:16:06 +02:00
parent 7ba1785183
commit 9562bd7ee2
2 changed files with 19 additions and 4 deletions

View File

@@ -125,7 +125,14 @@ sc_audio_player_frame_sink_open(struct sc_frame_sink *sink,
(void) ok; // We don't care if it worked, at least we tried
}
SDL_ResumeAudioDevice(ap->device);
ok = SDL_ResumeAudioDevice(ap->device);
if (!ok) {
LOGE("Could not resume audio device: %s", SDL_GetError());
SDL_DestroyAudioStream(ap->stream);
free(ap->aout_buffer);
sc_audio_regulator_destroy(&ap->audioreg);
return false;
}
return true;
}

View File

@@ -56,8 +56,11 @@ sc_display_init(struct sc_display *display, SDL_Window *window,
#ifdef SC_DISPLAY_FORCE_OPENGL_CORE_PROFILE
// Persuade macOS to give us something better than OpenGL 2.1.
// If we create a Core Profile context, we get the best OpenGL version.
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_PROFILE_CORE);
bool ok = SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_PROFILE_CORE);
if (!ok) {
LOGW("Could not set a GL Core Profile Context");
}
LOGD("Creating OpenGL Core Profile context");
display->gl_context = SDL_GL_CreateContext(window);
@@ -416,6 +419,11 @@ sc_display_render(struct sc_display *display, const SDL_Rect *geometry,
}
}
SDL_RenderPresent(display->renderer);
bool ok = SDL_RenderPresent(display->renderer);
if (!ok) {
LOGE("Could not render the content");
return SC_DISPLAY_RESULT_ERROR;
}
return SC_DISPLAY_RESULT_OK;
}