diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-10-04 00:29:59 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-10-04 01:32:27 +0200 |
commit | e80d7676d495ec703f0cedc10599e7c0d49a4f92 (patch) | |
tree | c3172e11056e9351d048ce0d34cf850ee5c2e17c /src/sound.cpp | |
parent | c354d88583277a5d38262be63ecd44ec4e2f5a59 (diff) |
Livestream: add silent audio track if not audio input is provided (fixes youtube and other sites)
Diffstat (limited to 'src/sound.cpp')
-rw-r--r-- | src/sound.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sound.cpp b/src/sound.cpp index 3eea498..e4086b1 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -283,7 +283,9 @@ int sound_device_get_by_name(SoundDevice *device, const char *device_name, const } void sound_device_close(SoundDevice *device) { - pa_sound_device_free((pa_handle*)device->handle); + if(device->handle) + pa_sound_device_free((pa_handle*)device->handle); + device->handle = NULL; } int sound_device_read_next_chunk(SoundDevice *device, void **buffer) { |