From f6aa35eedbc76e7467a68dbe3aba63ec8cb352a5 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期五, 26 七月 2019 10:51:03 +0800
Subject: [PATCH] add log
---
apipassive.go | 8 ++++----
csrc/wrapper.cpp | 1 +
csrc/cffmpeg.cpp | 6 +++---
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/apipassive.go b/apipassive.go
index 769c01f..90b82a9 100644
--- a/apipassive.go
+++ b/apipassive.go
@@ -26,10 +26,10 @@
var l C.int
p := C.wrap_fn_info_recorder(h.ffmpeg, &i, &l)
- if p == nil {
- return -1, ""
- }
- C.free(unsafe.Pointer(p))
+ // if p == nil {
+ // return -1, ""
+ // }
+ defer C.free(unsafe.Pointer(p))
return int(i), C.GoString(p)
}
diff --git a/csrc/cffmpeg.cpp b/csrc/cffmpeg.cpp
index cbb0b1f..05be1a3 100644
--- a/csrc/cffmpeg.cpp
+++ b/csrc/cffmpeg.cpp
@@ -63,9 +63,9 @@
int i;
std::string p;
s->GetInfoRecorder(i, p);
- if(p.empty()){
- return NULL;
- }
+
+ printf("cffmpeg get info : index : %d, file : %s\n", i, p.c_str());
+
*index = i;
*length = p.length();
char *path = (char*)malloc(*length + 1);
diff --git a/csrc/wrapper.cpp b/csrc/wrapper.cpp
index 82c5141..0b7b6ca 100644
--- a/csrc/wrapper.cpp
+++ b/csrc/wrapper.cpp
@@ -292,6 +292,7 @@
index = info.file_frame_index;
path = info.file_path;
list_rec_.pop_front();
+ logIt("go get info index: %d, file: %s\n", index, path.c_str());
}
////////decoder
--
Gitblit v1.8.0