From bfded635a544a1ab5d252739f4be4f7f30b39b7f Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期五, 26 七月 2019 14:46:48 +0800
Subject: [PATCH] update ffmpeg

---
 csrc/cffmpeg.cpp |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/csrc/cffmpeg.cpp b/csrc/cffmpeg.cpp
index 956d33c..f804054 100644
--- a/csrc/cffmpeg.cpp
+++ b/csrc/cffmpeg.cpp
@@ -58,12 +58,11 @@
     s->FireRecorder(sid, id);
 }
 
-char* c_ffmpeg_get_info_recorder(const cffmpeg h, char **sid, int *index, int *length){
+char* c_ffmpeg_get_info_recorder(const cffmpeg h, int *index, int *length){
     Wrapper *s = (Wrapper*)h;
     int i;
     std::string p;
-    std::string id;
-    s->GetInfoRecorder(id, i, p);
+    s->GetInfoRecorder(i, p);
 
     // printf("cffmpeg get info : index : %d, file : %s\n", i, p.c_str());
 
@@ -72,14 +71,20 @@
     char *path = (char*)malloc(*length + 1);
     memcpy(path, p.c_str(), *length);
     path[*length] = '\0';
-
-    *sid = (char*)malloc(id.length()+1);
-    memcpy(*sid, id.c_str(), id.length());
-    *sid[id.length()] = '\0';
     
     return path;
 }
 
+char* c_ffmpeg_get_rec_id(const cffmpeg h, const char* p, int *length){
+    Wrapper *s = (Wrapper*)h;
+    std::string id = s->GetRecorderID(p);
+    *length = id.length();
+    char *i = (char*)malloc(*length+1);
+    memcpy(i, id.c_str(), *length);
+    i[*length] = '\0';
+    return i;
+}
+
 void c_ffmpeg_build_decoder(const cffmpeg h){
     Wrapper *s = (Wrapper*)h;
     s->BuildDecoder();

--
Gitblit v1.8.0