Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* jshint node:true */
"use strict";
var spawn = require("child_process").spawn,
ffmpeg = spawn.bind(null, process.env.FFMPEG_PATH || "ffmpeg"),
fs = require("fs"),
through = require("through"),
concat = require("concat-stream");
module.exports.read = function(src, options, callback) {
if (typeof options === "function") {
callback = options;
options = {};
}
var args = getReadArgs(src, options);
if (options.dryRun) {
return args;
}
function command2function(cmd) {
switch (typeof cmd) {
case 'string':
var args = cmd.split(' ');
var command = args.shift();
cmd = spawn.bind(undefined, command, args);
break;
case 'object':
var command = cmd && cmd.command;
if (command) {
var args = cmd.args;
var options = cmd.options;
cmd = spawn.bind(undefined, command, args, options);
}
break;
}
return cmd
}
function command2function(cmd) {
switch (typeof cmd) {
case 'string':
var args = cmd.split(' ');
var command = args.shift();
cmd = spawn.bind(undefined, command, args);
break;
case 'object':
var command = cmd && cmd.command;
if (command) {
var args = cmd.args;
var options = cmd.options;
cmd = spawn.bind(undefined, command, args, options);
}
break;
}
return cmd
}
function command2function(cmd)
{
switch(typeof cmd)
{
case 'string':
{
var args = cmd.split(' ');
var command = args.shift();
cmd = spawn.bind(undefined, command, args);
}
break;
case 'object':
{
var command = cmd && cmd.command;
if(command)
{
var args = cmd.args;
var options = cmd.options;
cmd = spawn.bind(undefined, command, args, options);
}
}
break;
}
var args = cmd.split(' ');
var command = args.shift();
cmd = spawn.bind(undefined, command, args);
}
break;
case 'object':
{
var command = cmd && cmd.command;
if(command)
{
var args = cmd.args;
var options = cmd.options;
cmd = spawn.bind(undefined, command, args, options);
}
}
break;
}
return cmd
}