Skip to content

Commit

Permalink
fixed up version number determination (thank you ubuntu...)
Browse files Browse the repository at this point in the history
  • Loading branch information
schaermu committed Mar 8, 2012
1 parent 6e7f3f4 commit 0bdc5f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions lib/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ var meta = module.exports = {
var is_synched = (/start: 0.000000/.exec(stderr) != null);
var rotate = /rotate[\s]+:[\s]([\d]{2,3})/.exec(stderr);

console.log(stderr);
// get ffmpeg version
var getVersion = /ffmpeg version ([0-9\.]+) C/.exec(stderr);
var getVersion = /ffmpeg version (?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)/.exec(stderr);
var ffmpegVersion = 0;
if (getVersion) {
ffmpegVersion = getVersion[1];
if (!getVersion[2]) {
getVersion[2] = getVersion[3];
}
ffmpegVersion = getVersion[1] + '.' + getVersion[2];
if (!getVersion[3]) {
ffmpegVersion += '.' + getVersion[3];
}
}

// build return object
Expand Down
1 change: 0 additions & 1 deletion test/conversion.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module.exports = testCase({
.usingPreset('flashvideo')
.renice(19)
.saveToFile(testFile, function(stdout, stderr, err) {
console.log(stderr);
test.ok(!err);
path.exists(testFile, function(exist) {
test.ok(exist);
Expand Down

0 comments on commit 0bdc5f1

Please sign in to comment.