From e80ef6acf886a67fa9136fdc8312971cef91b534 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期二, 24 九月 2019 16:41:55 +0800
Subject: [PATCH] 增加addCamera的返回值校验

---
 csrc/thirdparty/gb28181/include/PsToEs.hpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/csrc/thirdparty/gb28181/include/PsToEs.hpp b/csrc/thirdparty/gb28181/include/PsToEs.hpp
index a46f516..2ac629d 100644
--- a/csrc/thirdparty/gb28181/include/PsToEs.hpp
+++ b/csrc/thirdparty/gb28181/include/PsToEs.hpp
@@ -174,16 +174,19 @@
 		}
 	}
 
-	void addCamera(string &rtsp){
+	long addCamera(string &rtsp){
 //		long userdata = 1001;//
-		printf("RTSPSTREAM_Open\n");
 		handle = RTSPSTREAM_Open(rtsp.c_str(), streamCallBack, (long)this);
-//		return handle;
+		printf("RTSPSTREAM_Open, handle:%ld \n", handle);
+		return handle;
 	}
 
 	void deleteCamera(){
 		printf("RTSPSTREAM_Close\n");
-		RTSPSTREAM_Close(handle);
+		if(handle != -1){
+			RTSPSTREAM_Close(handle);
+		}
+
 		handle = -1;
 	}	
 private:

--
Gitblit v1.8.0