Fix ffmpeg fd leak

This commit is contained in:
calzoneman 2015-08-10 17:55:23 -07:00
parent 6f7b34f644
commit 3cac6d2d10
1 changed files with 3 additions and 1 deletions

View File

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