diff --git a/simple_live_transcode.c b/simple_live_transcode.c
index d9829807d2bd6833cbac64f84e00eb87b496e7bf..e8dfbdf65c1c948f56eaa9147fbd113c6cdafdea 100644
--- a/simple_live_transcode.c
+++ b/simple_live_transcode.c
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
 	while (1)
 	{
 		canceled = ping_job(jobid, "running", "{\"log\": \"%s\"}", jescape(get_avlogbuf()));
-		if (canceled)
+		if (canceled == 1)
 			kill(pid, SIGINT); /* Stop ffmpeg */
 		poll(&fds, 1, 15000);
 		if (fds.revents & POLLIN)
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
 	}
 
 	waitpid(pid, &ret, 0);
-	if (canceled && (WEXITSTATUS(ret) == 255 || (WIFSIGNALED(ret) && WTERMSIG(ret) == SIGINT)))
+	if (canceled == 1 && (WEXITSTATUS(ret) == 255 || (WIFSIGNALED(ret) && WTERMSIG(ret) == SIGINT)))
 		ping_job(jobid, "finished", "{\"log\": \"%s\"}", jescape(get_avlogbuf()));
 	else if (WIFSIGNALED(ret))
 		job_failed("Subprocesses was killed by signal %s (%i)", strsignal(WTERMSIG(ret)), WTERMSIG(ret));
diff --git a/transcode.c b/transcode.c
index 357ab1c30dd6f9f3a0ea3e5880579f9d223b1d8d..84bec33a899e73ec6c3db9bbc2c95676024de749 100644
--- a/transcode.c
+++ b/transcode.c
@@ -337,7 +337,7 @@ int main(int argc, char *argv[])
 		{
 			canceled = ping_job(jobid, "running", "{\"progress\": %i, \"log\": \"%s\"}", _progress,
 					jescape(get_avlogbuf()));
-			if (canceled)
+			if (canceled == 1)
 				job_failed("Job canceled");
 			progress = _progress;
 		}