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.
This commit is contained in:
commit
ab2671e564
@ -88,7 +88,7 @@ module.exports = (_options = {}) => {
|
|||||||
return prefix + path;
|
return prefix + path;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);
|
ffmpeg = Core.cwrap(options.mainName || 'proxy_main', 'number', ['number', 'number']);
|
||||||
log('info', 'ffmpeg-core loaded');
|
log('info', 'ffmpeg-core loaded');
|
||||||
} else {
|
} else {
|
||||||
throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');
|
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 = {}) => {
|
|||||||
throw NO_LOAD;
|
throw NO_LOAD;
|
||||||
} else {
|
} else {
|
||||||
running = false;
|
running = false;
|
||||||
|
try {
|
||||||
Core.exit(1);
|
Core.exit(1);
|
||||||
|
} catch(e) {
|
||||||
|
console.log('catch core exit error', e);
|
||||||
|
}
|
||||||
Core = null;
|
Core = null;
|
||||||
ffmpeg = null;
|
ffmpeg = null;
|
||||||
runResolve = null;
|
runResolve = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user