mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-16 21:14:20 +01:00
fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user