From 54af47fc4366dfacfb3b9aa021f8c41eacee5053 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Wed, 20 Jul 2022 13:04:18 +0300 Subject: [PATCH] fix --- janus/src/plugin.c | 4 +--- python/src/ustreamer.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/janus/src/plugin.c b/janus/src/plugin.c index d7fd7f1..5c9da7a 100644 --- a/janus/src/plugin.c +++ b/janus/src/plugin.c @@ -166,11 +166,9 @@ static void *_video_sink_thread(UNUSED void *arg) { if (mem != NULL) { US_JLOG_INFO("video", "Memsink closed"); us_memsink_shared_unmap(mem); - mem = NULL; } - if (fd > 0) { + if (fd >= 0) { close(fd); - fd = -1; } sleep(1); // error_delay } diff --git a/python/src/ustreamer.c b/python/src/ustreamer.c index 4786555..ee312bb 100644 --- a/python/src/ustreamer.c +++ b/python/src/ustreamer.c @@ -44,7 +44,7 @@ static void _MemsinkObject_destroy_internals(_MemsinkObject *self) { us_memsink_shared_unmap(self->mem); self->mem = NULL; } - if (self->fd > 0) { + if (self->fd >= 0) { close(self->fd); self->fd = -1; }