Skip to content

Commit

Permalink
Fix ffmpeg and handle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
qgustavor committed May 27, 2024
1 parent aad9bbb commit cc649fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/extract-streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default async function* extractStreams (files, results, preferences) {

function runCommand (file, argv) {
return new Promise((resolve, reject) => {
const worker = new Worker('./ffmpeg-worker-mkve.js')
const worker = new Worker('../ffmpeg-worker-mkve.js')
let stdout = ''
let stderr = ''

Expand Down Expand Up @@ -200,6 +200,7 @@ function runCommand (file, argv) {
}

worker.addEventListener('message', messageHandler)
worker.addEventListener('error', reject)
})
}

Expand Down
3 changes: 3 additions & 0 deletions src/utils/handle-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ function handleFile (file, preferences) {
let stdout = ''
let stderr = ''

worker.addEventListener('error', error => {
resolve({ error, stdout, stderr })
})
worker.addEventListener('message', e => {
const msg = e.data

Expand Down

0 comments on commit cc649fb

Please sign in to comment.