add workaround for manually-created ffmpeg archive

This commit is contained in:
Simon Knott 2024-12-18 14:34:02 +01:00
parent f0713379bc
commit 45b84b7fcd
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 8 additions and 1 deletions

View file

@ -762,6 +762,7 @@ export class Registry {
const ffmpeg = descriptors.find(d => d.name === 'ffmpeg')!;
const ffmpegExecutable = findExecutablePath(ffmpeg.dir, 'ffmpeg');
console.log(ffmpegExecutable)
this._executables.push({
type: 'tool',
name: 'ffmpeg',

View file

@ -150,7 +150,13 @@ async function downloadAndExtractBrotli(options: DownloadParams) {
await pipeline(
response,
createBrotliDecompress(),
tarFs.extract(options.browserDirectory)
tarFs.extract(options.browserDirectory, {
map(header: { name: string }) {
// manually-created ffmpeg archive has files nested in subdirectory
if (header.name.startsWith('ffmpeg-'))
header.name = header.name.substring(header.name.indexOf('/'));
}
})
);
if (downloadedBytes !== totalBytes)