Browse Source

Fixed rtcIsOpen() and rtcIsClosed() return value for invalid channel

Paul-Louis Ageneau 3 years ago
parent
commit
a3b9d27b86
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/capi.cpp

+ 2 - 2
src/capi.cpp

@@ -676,11 +676,11 @@ int rtcSendMessage(int id, const char *data, int size) {
 }
 }
 
 
 bool rtcIsOpen(int id) {
 bool rtcIsOpen(int id) {
-	return wrap([id] { return getChannel(id)->isOpen(); });
+	return wrap([id] { return getChannel(id)->isOpen() ? 0 : 1; }) == 0 ? true : false;
 }
 }
 
 
 bool rtcIsClosed(int id) {
 bool rtcIsClosed(int id) {
-	return wrap([id] { return getChannel(id)->isClosed(); });
+	return wrap([id] { return getChannel(id)->isClosed() ? 0 : 1; }) == 0 ? true : false ;
 }
 }
 
 
 int rtcGetBufferedAmount(int id) {
 int rtcGetBufferedAmount(int id) {