Skip to content

Commit

Permalink
finish 时重置 task key,由于这个 key 的存在,不能同时处理多个任务
Browse files Browse the repository at this point in the history
  • Loading branch information
lingyunxiao2 committed Mar 10, 2022
1 parent 242bb3f commit 3c3610d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gifski/src/main/cpp/gifski/GifskiJniApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ JNI_FUNC(startProcess)(JNIEnv *env, jclass type,
struct ProgressCallback {
static int onFrameWrited(int user_data, int write_count, int frame_number) {
auto env = GetJniEnv();
logStr(env, "frame writed:%d/%d task:%d user:%d", frame_number, write_count, taskKey, user_data);
logStr(env, "frame writed index:%d writed_count:%d key:%d vs %d", frame_number, write_count, taskKey, user_data);
progressCallback(env, write_count, user_data);
return user_data == taskKey ? 1 : 0;
}
Expand Down Expand Up @@ -150,6 +150,7 @@ JNI_FUNC(finish)(JNIEnv *env, jclass type, jlong instancePtr) {
logStr(env, "start to finish");
int result = gifski_finish(env, instance);
logStr(env, "finish result:%d", result);
taskKey = 0;
return result;
}

Expand Down

0 comments on commit 3c3610d

Please sign in to comment.