@qvac/decoder-audio 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ffmpeg/ffmpeg-decoder.js +26 -0
- package/package.json +1 -1
- package/prebuilds/android-arm/qvac__decoder-audio.bare +0 -0
- package/prebuilds/android-arm64/qvac__decoder-audio.bare +0 -0
- package/prebuilds/android-ia32/qvac__decoder-audio.bare +0 -0
- package/prebuilds/android-x64/qvac__decoder-audio.bare +0 -0
- package/prebuilds/darwin-arm64/qvac__decoder-audio.bare +0 -0
- package/prebuilds/darwin-arm64/qvac__decoder-audio.bare.exports +1 -1
- package/prebuilds/ios-arm64/qvac__decoder-audio.bare +0 -0
- package/prebuilds/ios-arm64/qvac__decoder-audio.bare.exports +1 -1
- package/prebuilds/ios-arm64-simulator/qvac__decoder-audio.bare +0 -0
- package/prebuilds/ios-arm64-simulator/qvac__decoder-audio.bare.exports +1 -1
- package/prebuilds/ios-x64-simulator/qvac__decoder-audio.bare +0 -0
- package/prebuilds/ios-x64-simulator/qvac__decoder-audio.bare.exports +1 -1
- package/prebuilds/linux-x64/qvac__decoder-audio.bare +0 -0
- package/prebuilds/win32-x64/qvac__decoder-audio.bare +0 -0
|
@@ -312,6 +312,32 @@ class FFmpegDecoder extends BaseInference {
|
|
|
312
312
|
|
|
313
313
|
this.logger.debug(`[FFmpegDecoder] Read ${bytesToRead} bytes from buffer, offset now: ${bufferOffset}`)
|
|
314
314
|
return bytesToRead
|
|
315
|
+
},
|
|
316
|
+
onseek: (offset, whence) => {
|
|
317
|
+
const AVSEEK_SIZE = 0x10000
|
|
318
|
+
|
|
319
|
+
if (whence === AVSEEK_SIZE) {
|
|
320
|
+
return audioBuffer.length
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
let newOffset
|
|
324
|
+
if (whence === 0) {
|
|
325
|
+
newOffset = offset
|
|
326
|
+
} else if (whence === 1) {
|
|
327
|
+
newOffset = bufferOffset + offset
|
|
328
|
+
} else if (whence === 2) {
|
|
329
|
+
newOffset = audioBuffer.length + offset
|
|
330
|
+
} else {
|
|
331
|
+
return -1
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (newOffset < 0 || newOffset > audioBuffer.length) {
|
|
335
|
+
return -1
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
bufferOffset = newOffset
|
|
339
|
+
this.logger.debug(`[FFmpegDecoder] Seek to offset: ${bufferOffset}`)
|
|
340
|
+
return bufferOffset
|
|
315
341
|
}
|
|
316
342
|
})
|
|
317
343
|
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|