Permalink
Browse files

cleaned some trailing whitespace, added swp files to gitignore, tryin…

…g out travis cli so I don't break the build next time :-X
  • Loading branch information...
1 parent cc90f3e commit 512d3c9d87e47e31ef01acef90c84712dc3ec34f @jlank jlank committed Jun 6, 2012
Showing with 21 additions and 20 deletions.
  1. +2 −1 .gitignore
  2. +16 −16 lib/fluent-ffmpeg.js
  3. +3 −3 lib/processor.js
View
@@ -1,3 +1,4 @@
*.project
node_modules
-lib-cov
+lib-cov
+*.swp
View
@@ -50,7 +50,7 @@ function FfmpegCommand(args) {
// file mode
srcfile = source;
}
-
+
this.options = {
_isStreamable: true,
_updateFlvMetadata: false,
@@ -68,21 +68,21 @@ function FfmpegCommand(args) {
};
var presets = {};
-
+
// load presets
fs.readdirSync(__dirname + '/presets').forEach(function(file) {
var modname = file.substring(0, file.length - 3);
if (file.substring(0, 1) === '.') {
return true;
}
-
+
var preset = require('./presets/' + modname);
if (typeof preset.load === 'function') {
presets[modname] = preset;
}
});
-
+
// public chaining methods
FfmpegCommand.prototype.usingPreset = function(preset) {
if (presets[preset]) {
@@ -117,7 +117,7 @@ function FfmpegCommand(args) {
if (!color) {
this.options.video.padcolor = 'black';
} else {
- this.options.video.padcolor = color;
+ this.options.video.padcolor = color;
}
return this;
};
@@ -148,7 +148,7 @@ function FfmpegCommand(args) {
this.options.audio.channels = audiochannels;
return this;
};
- FfmpegCommand.prototype.withAudioFrequency = function(frequency) {
+ FfmpegCommand.prototype.withAudioFrequency = function(frequency) {
this.options.audio.frequency = frequency;
return this;
};
@@ -168,7 +168,7 @@ function FfmpegCommand(args) {
var values = el.split(' ');
self.options.additional.push(values[0], values[1]);
} else {
- self.options.additional.push(el);
+ self.options.additional.push(el);
}
});
}
@@ -180,7 +180,7 @@ function FfmpegCommand(args) {
};
FfmpegCommand.prototype.toFormat = function(format) {
this.options.format = format;
-
+
// some muxers require the output stream to be seekable, disable streaming for those formats
if (this.options.format === 'mp4') {
this.options._isStreamable = false;
@@ -224,18 +224,18 @@ function FfmpegCommand(args) {
}
return b;
};
-
+
// private methods
FfmpegCommand.prototype._prepare = function(callback) {
var calcDimensions = false, calcPadding = false;
-
+
// check for allowed sizestring formats and handle them accordingly
var fixedWidth = /([0-9]+)x\?/.exec(this.options.video.size);
var fixedHeight = /\?x([0-9]+)/.exec(this.options.video.size);
var percentRatio = /\b([0-9]{1,2})%/.exec(this.options.video.size);
if (!fixedWidth && !fixedHeight && !percentRatio) {
- // check for invalid size string
+ // check for invalid size string
var defaultSizestring = /([0-9]+)x([0-9]+)/.exec(this.options.video.size);
if (this.options.video.size && !defaultSizestring) {
callback(new Error('could not parse size string, aborting execution'));
@@ -251,12 +251,12 @@ function FfmpegCommand(args) {
} else {
calcDimensions = true;
}
-
+
// check if we have to check aspect ratio for changes and auto-pad the output
if (this.options._applyAutopad) {
calcPadding = true;
}
-
+
var self = this;
this.getMetadata(this.options.inputfile, function(meta, err) {
if (calcDimensions || calcPadding) {
@@ -265,12 +265,12 @@ function FfmpegCommand(args) {
if (calcDimensions) {
dimErr = self._calculateDimensions(meta);
}
-
+
// calculate padding
if (calcPadding) {
padErr = self._calculatePadding(meta);
}
-
+
if (dimErr || padErr) {
callback(new Error('error while preparing: dimension -> ' + dimErr + ' padding -> ' + padErr));
} else {
@@ -299,4 +299,4 @@ exports = module.exports = function(args) {
exports.Metadata = require('./metadata');
exports.CONSTANT_BITRATE = 1;
-exports.VARIABLE_BITRATE = 2;
+exports.VARIABLE_BITRATE = 2;
View
@@ -288,7 +288,7 @@ exports = module.exports = function Processor(command) {
}
var self = this;
-
+
// WORKAROUND: existsSync will be moved from path to fs with node v0.7
var check = fs.existsSync;
if (!check) {
@@ -437,7 +437,7 @@ exports = module.exports = function Processor(command) {
if (this.options.audio.skip) {
// skip audio stream completely (#45)
args.push('-an');
- } else {
+ } else {
if (this.options.audio.bitrate) {
args.push('-ab', this.options.audio.bitrate + 'k');
}
@@ -489,7 +489,7 @@ exports = module.exports = function Processor(command) {
this.options.logger.error('no outputfile specified');
}
}
-
+//console.log(args);
return args;
};
};

0 comments on commit 512d3c9

Please sign in to comment.