|
@@ -10,6 +10,7 @@
|
|
|
#include "video_similarity.h"
|
|
|
|
|
|
|
|
|
+
|
|
|
const int MAX_STACK_FRAMES = 128;
|
|
|
|
|
|
void sig_crash(int sig) {
|
|
@@ -62,7 +63,7 @@ void sig_crash(int sig) {
|
|
|
size_t pos2 = symbol.find_last_of("]");
|
|
|
std::string address = symbol.substr(pos1 + 1, pos2 - pos1 -1);
|
|
|
char cmd[128] = {0, };
|
|
|
- sprintf(cmd, "addr2line -e video_similarity_comparison %s", address.c_str()); // test为应用程序名称,需要改为用户自己的应用程序名
|
|
|
+ sprintf(cmd, "addr2line -e /home/libpiaoquan_java_opencv.so %s", address.c_str()); // test为应用程序名称,需要改为用户自己的应用程序名
|
|
|
FILE *fPipe = popen(cmd, "r");
|
|
|
if(fPipe != NULL){
|
|
|
char buff[1024];
|
|
@@ -141,7 +142,10 @@ int video_similarity_detection_start(long id, int force_keyframe,
|
|
|
|
|
|
if (len > 0) {
|
|
|
model->image_hash = static_cast<const char *>(malloc(sizeof(char) * len));
|
|
|
- memcpy((void *) model->image_hash, image_hash, len);
|
|
|
+ memset((void*)model->image_hash,'\0',sizeof(char) * len);
|
|
|
+ strcpy((char *)model->image_hash,image_hash);
|
|
|
+ if (image_hash)
|
|
|
+ free((void *) image_hash);
|
|
|
}
|
|
|
|
|
|
if (video_frame->pts >= endTimeMs && (*lists).size() > 1 && index + 1 < (*lists).size()) {
|
|
@@ -152,8 +156,8 @@ int video_similarity_detection_start(long id, int force_keyframe,
|
|
|
// LOGE("push pts >>>>= %lld \n", model->pts);
|
|
|
(*lists)[index]->hashs.push_back(model);
|
|
|
if (ctx->log)fprintf(ctx->log, "image_hash \n");
|
|
|
- if (image_hash)
|
|
|
- free((void *) image_hash);
|
|
|
+
|
|
|
+ image_hash = NULL;
|
|
|
if (ctx->log) fprintf(ctx->log, "av_frame_free\n");
|
|
|
av_frame_free(&video_frame);
|
|
|
if (ctx->log) fprintf(ctx->log, "av_frame_free 2\n");
|
|
@@ -240,6 +244,7 @@ const char *videoSimilarity2json(VideoSimilarity *videoSimilarity) {
|
|
|
}
|
|
|
va["imageHash"] = append_array.c_str();
|
|
|
free((void *) item2->image_hash);
|
|
|
+ item2->image_hash = NULL;
|
|
|
}
|
|
|
va["hashSize"] = item2->img_len;
|
|
|
va["pts"] = item2->pts;
|