Skip to content
This repository was archived by the owner on Mar 25, 2019. It is now read-only.

Commit b09425b

Browse files
author
Sjoerd Tieleman
committed
Closes #19 and #20. Transcoder no longer gets into a weird state if ffmpeg fails to execute.
1 parent c3d45ab commit b09425b

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## codem-transcode 0.5.3 (not yet released) ##
2+
3+
* Bugfix: issue #19 and #20, missing or corrupt ffmpeg will no longer put transcoder in weird state.
4+
15
## codem-transcode 0.5.2 (2013/09/10) ##
26

37
* Bugfix: migrations should create "Jobs" table (instead of "jobs")

lib/job.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ var Job = JobUtils.getDatabase().define('Job', {
258258
args.push('-f', 'null', '-acodec', 'copy', '-vcodec', 'copy', '-y', null_file);
259259
}
260260

261-
var the_process = child_process.spawn(config['encoder'], args);
262-
the_process.stderr.on('data', function(data) { job.progressHandler(data) });
261+
var the_process = child_process.spawn(config['encoder'], args);
262+
263+
the_process.stderr.on('data', function(data) { job.progressHandler(data); });
264+
the_process.on('error', function(err) { job.lastMessage = 'Unable to execute the ffmpeg binary: ' + err; job.didFinish(1); });
263265
the_process.on('exit', function(code) { job.didFinish(code); });
264266

265267
this.the_process = the_process;

0 commit comments

Comments
 (0)