Skip to content

Commit 6ebc08f

Browse files
committed
Update the position of opts to fix bugs
1 parent 69a2a62 commit 6ebc08f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/createWorker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ module.exports = (_options = {}) => {
108108

109109
const transcode = (input, output, opts = '', del = true, jobId) => (
110110
run(
111-
`${opts} -i /data/${input} ${output}`,
111+
`-i /data/${input} ${opts} ${output}`,
112112
{ input, output, del },
113113
jobId,
114114
)
115115
);
116116

117117
const trim = (input, output, from, to, opts = '', del = true, jobId) => (
118118
run(
119-
`${opts} -i /data/${input} -ss ${from} -to ${to} ${output}`,
119+
`-i /data/${input} -ss ${from} -to ${to} ${opts} ${output}`,
120120
{ input, output, del },
121121
jobId,
122122
)
@@ -125,7 +125,7 @@ module.exports = (_options = {}) => {
125125
const concatDemuxer = async (input, output, opts = '', del = true, jobId) => {
126126
const text = input.reduce((acc, path) => `${acc}\nfile ${path}`, '');
127127
await writeText('concat_list.txt', text);
128-
return run(`${opts} -f concat -safe 0 -i /data/concat_list.txt -c copy ${output}`,
128+
return run(`-f concat -safe 0 -i /data/concat_list.txt -c copy ${opts} ${output}`,
129129
{ del, output, input: [...input, 'concat_list.txt'] },
130130
jobId);
131131
};

src/worker-script/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const run = async ({
5757
},
5858
},
5959
}, res) => {
60-
const args = [...defaultArgs, ..._args.trim().split(' ')];
60+
const args = [...defaultArgs, ..._args.trim().split(' ')].filter((s) => s.length !== 0);
6161
ffmpeg(args.length, strList2ptr(Module, args));
6262

6363
/*

0 commit comments

Comments
 (0)