From 7435e86bcabdf7bc2aa9604b05851b5810b47380 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期四, 19 十二月 2019 14:08:46 +0800
Subject: [PATCH] update

---
 gohumantrack/gohumantrack.go |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/gohumantrack/gohumantrack.go b/gohumantrack/gohumantrack.go
index 8fa2c1d..e7327ab 100644
--- a/gohumantrack/gohumantrack.go
+++ b/gohumantrack/gohumantrack.go
@@ -39,18 +39,16 @@
 	}
 	return ret;
 }
-void *process(void *handle, void *imgs, const int size, void *result){
+int process(void *handle, void *imgs, const int size, void *result){
 	c_img *images = (c_img*)imgs;
 	c_fgRet *res = (c_fgRet *)result;
-	int ret = c_human_tracker_process(handle, images, size, res);
-	if (ret != 0)
-		return NULL;
-	return res;
+	return c_human_tracker_process(handle, images, size, res);
 }
 */
 import "C"
 import (
 	"errors"
+	"fmt"
 	"math"
 	"unsafe"
 )
@@ -189,12 +187,12 @@
 	}
 
 	cRet := C.process(h.handle, cImgs, C.int(h.batchSize), h.result)
-	if cRet == nil {
-		return nil, errors.New("create C results error")
+	if cRet != 0 {
+		return nil, fmt.Errorf("process error: %d", cRet)
 	}
 
 	var result []FgResult
-	p := uintptr(cRet)
+	p := uintptr(h.result)
 	for i := 0; i < h.batchSize; i++ {
 		j := *(*FgResult)(unsafe.Pointer(p))
 		result = append(result, j)

--
Gitblit v1.8.0