Skip to content

Commit 42ef98a

Browse files
authored
Merge pull request #235 from seminelee/master
Add `mainName` option,the main function name of custom ffmpeg-core.js script. And catch the exit Error.
2 parents 2d6fae8 + daf3d5f commit 42ef98a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/createFFmpeg.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ module.exports = (_options = {}) => {
8888
return prefix + path;
8989
},
9090
});
91-
ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);
91+
ffmpeg = Core.cwrap(options.mainName || 'proxy_main', 'number', ['number', 'number']);
9292
log('info', 'ffmpeg-core loaded');
9393
} else {
9494
throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');
@@ -178,7 +178,11 @@ module.exports = (_options = {}) => {
178178
throw NO_LOAD;
179179
} else {
180180
running = false;
181-
Core.exit(1);
181+
try {
182+
Core.exit(1);
183+
} catch(e) {
184+
console.log('catch core exit error', e);
185+
}
182186
Core = null;
183187
ffmpeg = null;
184188
runResolve = null;

0 commit comments

Comments
 (0)