mirror of https://github.com/calzoneman/sync.git
Fix ffmpeg fd leak
This commit is contained in:
parent
6f7b34f644
commit
3cac6d2d10
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue