Fix ffmpeg fd leak

This commit is contained in:
calzoneman 2015-08-10 17:55:23 -07:00
parent 6f7b34f644
commit 3cac6d2d10

View file

@ -30,10 +30,12 @@ var audioOnlyContainers = {
function fflog() { } function fflog() { }
function initFFLog() { function initFFLog() {
if (fflog.initialized) return;
var logger = new Logger.Logger(path.resolve(__dirname, "..", "ffmpeg.log")); var logger = new Logger.Logger(path.resolve(__dirname, "..", "ffmpeg.log"));
fflog = function () { fflog = function () {
logger.log.apply(logger, arguments); logger.log.apply(logger, arguments);
}; };
fflog.initialized = true;
} }
function testUrl(url, cb, redirCount) { function testUrl(url, cb, redirCount) {
@ -215,7 +217,7 @@ exports.ffprobe = function ffprobe(filename, cb) {
} }
exports.query = function (filename, cb) { exports.query = function (filename, cb) {
if (Config.get("ffmpeg.log")) { if (Config.get("ffmpeg.log") && !fflog.initialized) {
initFFLog(); initFFLog();
} }