Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use test instead of exec in conditionals for testing regex matches. #84

Merged
merged 2 commits into from Nov 28, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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'));

Expand Down
4 changes: 2 additions & 2 deletions lib/processor.js
Expand Up @@ -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);
Expand Down