File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ const strList2ptr = (strList) => {
26
26
return listPtr ;
27
27
} ;
28
28
29
+ const doRun = ( _args ) => {
30
+ const args = [ ...defaultArgs , ..._args . trim ( ) . split ( ' ' ) ] ;
31
+ ffmpeg ( args . length , strList2ptr ( args ) ) ;
32
+ } ;
33
+
29
34
const load = ( { workerId, payload : { options : { corePath } } } , res ) => {
30
35
if ( Module == null ) {
31
36
const Core = adapter . getCore ( corePath ) ;
@@ -63,8 +68,7 @@ const transcode = ({
63
68
options = '' ,
64
69
} ,
65
70
} , res ) => {
66
- const args = [ ...defaultArgs , ...`${ options } -i ${ inputPath } ${ outputPath } ` . trim ( ) . split ( ' ' ) ] ;
67
- ffmpeg ( args . length , strList2ptr ( args ) ) ;
71
+ doRun ( `${ options } -i ${ inputPath } ${ outputPath } ` ) ;
68
72
res . resolve ( { message : `Complete transcoding ${ inputPath } to ${ outputPath } ` } ) ;
69
73
} ;
70
74
@@ -78,12 +82,11 @@ const read = ({
78
82
79
83
const run = ( {
80
84
payload : {
81
- args : _args ,
85
+ args,
82
86
} ,
83
87
} , res ) => {
84
- const args = [ ...defaultArgs , ..._args . trim ( ) . split ( ' ' ) ] ;
85
- ffmpeg ( args . length , strList2ptr ( args ) ) ;
86
- res . resolve ( { message : `Complete ./ffmpeg ${ _args } ` } ) ;
88
+ doRun ( args ) ;
89
+ res . resolve ( { message : `Complete ./ffmpeg ${ args } ` } ) ;
87
90
} ;
88
91
89
92
exports . dispatchHandlers = ( packet , send ) => {
You can’t perform that action at this time.
0 commit comments