Permalink
Browse files

Merge pull request #84 from nickdesaulniers/master

Use test instead of exec in conditionals for testing regex matches.
  • Loading branch information...
2 parents e9da7dd + c842393 commit d76ca386f34592932de08be99d2196ea0f1fa26d @schaermu schaermu committed Nov 28, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 examples/express-stream.js
  2. +2 −2 lib/processor.js
View
2 examples/express-stream.js
@@ -1,7 +1,7 @@
var express = require('express'),
ffmpeg = require('../index');
-var app = express.createServer();
+var app = express();
app.use(express.static(__dirname + '/flowplayer'));
View
4 lib/processor.js
@@ -459,9 +459,9 @@ exports = module.exports = function Processor(command) {
if (this.options.video.fpsInput) {
args.push('-r', this.options.video.fpsInput);
}
- if (/^[a-z]+:\/\//.exec(this.options.inputfile)) {
+ if (/^[a-z]+:\/\//.test(this.options.inputfile)) {
args.push('-i', this.options.inputfile.replace(' ', '%20'));
- } else if (/%\d*d/.exec(this.options.inputfile)) { // multi-file format - http://ffmpeg.org/ffmpeg.html#image2-1
+ } else if (/%\d*d/.test(this.options.inputfile)) { // multi-file format - http://ffmpeg.org/ffmpeg.html#image2-1
args.push('-i', this.options.inputfile.replace(' ', '\ '));
} else {
var fstats = fs.statSync(this.options.inputfile);

0 comments on commit d76ca38

Please sign in to comment.