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;
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
      ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);
 | 
			
		||||
      ffmpeg = Core.cwrap(options.mainName || 'proxy_main', 'number', ['number', 'number']);
 | 
			
		||||
      log('info', 'ffmpeg-core loaded');
 | 
			
		||||
    } else {
 | 
			
		||||
      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;
 | 
			
		||||
    } else {
 | 
			
		||||
      running = false;
 | 
			
		||||
      Core.exit(1);
 | 
			
		||||
      try {
 | 
			
		||||
        Core.exit(1);
 | 
			
		||||
      } catch(e) {
 | 
			
		||||
        console.log('catch core exit error', e);
 | 
			
		||||
      }
 | 
			
		||||
      Core = null;
 | 
			
		||||
      ffmpeg = null;
 | 
			
		||||
      runResolve = null;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user