Skip to content

Commit e335521

Browse files
committed
Fix lint error
1 parent cad55a0 commit e335521

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/createFFmpeg.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed lo
77

88
module.exports = (_options = {}) => {
99
const {
10-
log: logging,
10+
log: optLog,
1111
logger,
1212
progress: optProgress,
1313
...options
@@ -22,6 +22,7 @@ module.exports = (_options = {}) => {
2222
let runReject = null;
2323
let running = false;
2424
let customLogger = () => {};
25+
let logging = optLog;
2526
let progress = optProgress;
2627
let duration = 0;
2728
let ratio = 0;
@@ -44,22 +45,22 @@ module.exports = (_options = {}) => {
4445
const [h, m, s] = ts.split(':');
4546
return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);
4647
};
47-
const parseProgress = (message, progress) => {
48+
const parseProgress = (message, prog) => {
4849
if (typeof message === 'string') {
4950
if (message.startsWith(' Duration')) {
5051
const ts = message.split(', ')[0].split(': ')[1];
5152
const d = ts2sec(ts);
52-
progress({ duration: d, ratio });
53+
prog({ duration: d, ratio });
5354
if (duration === 0 || duration > d) {
5455
duration = d;
5556
}
5657
} else if (message.startsWith('frame') || message.startsWith('size')) {
5758
const ts = message.split('time=')[1].split(' ')[0];
5859
const t = ts2sec(ts);
5960
ratio = t / duration;
60-
progress({ ratio, time: t });
61+
prog({ ratio, time: t });
6162
} else if (message.startsWith('video:')) {
62-
progress({ ratio: 1 });
63+
prog({ ratio: 1 });
6364
duration = 0;
6465
}
6566
}
@@ -213,8 +214,8 @@ module.exports = (_options = {}) => {
213214
throw NO_LOAD;
214215
} else {
215216
// if there's any pending runs, reject them
216-
if(runReject) {
217-
runReject('ffmpeg has exited')
217+
if (runReject) {
218+
runReject('ffmpeg has exited');
218219
}
219220
running = false;
220221
try {

0 commit comments

Comments
 (0)