diff options
| author | Mikhail Burakov <mburakov@mailbox.org> | 2024-05-19 14:55:38 +0200 |
|---|---|---|
| committer | Mikhail Burakov <mburakov@mailbox.org> | 2024-05-19 14:55:38 +0200 |
| commit | d574506bca29d93b3ab80a031f8abd383dd317e1 (patch) | |
| tree | eed4cac5ebda9f517e3b4653fcccfea235bb9590 | |
| parent | bf2d837de96d726e4e7361d99fee92ebf90d3ab3 (diff) | |
Do not crash when audio capturing is disabled
| -rw-r--r-- | main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -364,7 +364,8 @@ int main(int argc, char* argv[]) { goto rollback_io_muxer; } - if (!IoMuxerOnRead(&contexts.io_muxer, + if (contexts.audio_context && + !IoMuxerOnRead(&contexts.io_muxer, AudioContextGetEventsFd(contexts.audio_context), &OnAudioContextEvents, &contexts)) { LOG("Failed to schedule audio io (%s)", strerror(errno)); @@ -394,7 +395,7 @@ rollback_io_muxer: IoMuxerDestroy(&contexts.io_muxer); GpuContextDestroy(contexts.gpu_context); rollback_audio_context: - if (!disable_audio) AudioContextDestroy(contexts.audio_context); + if (contexts.audio_context) AudioContextDestroy(contexts.audio_context); bool result = g_signal == SIGINT || g_signal == SIGTERM; return result ? EXIT_SUCCESS : EXIT_FAILURE; } |
