Skip to content

Commit

Permalink
Move pop out to root split func
Browse files Browse the repository at this point in the history
  • Loading branch information
Tooseriuz committed Jun 21, 2024
1 parent 1d302b2 commit 843499c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 7 additions & 0 deletions services/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ function split (sourceFile, destinationPath, maxDuration) {
}
} catch (e) { reject(e) }
})
/*
* There is a very rare case that the segment is very small, 0.0000x second.
* With this small segment, the sample count will be null so we have to exclude it
*/
if (!outputFiles[outputFiles.length - 1].meta.sampleCount) {
outputFiles.pop()
}
resolve(Promise.all(outputFiles))
})
.run()
Expand Down
7 changes: 0 additions & 7 deletions services/rfcx/ingest.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@ function combineSegmentsData (outputFiles, upload) {
fileSize: file.meta.size
}
})
/*
* There is a very rare case that the segment is very small, 0.0000x second.
* With this small segment, the sample count will be null so we have to exclude it
*/
if (!combinedData[combinedData.length - 1].sampleCount) {
combinedData.pop()
}
return combinedData
}

Expand Down

0 comments on commit 843499c

Please sign in to comment.