Skip to content

Commit 4d5bfcf

Browse files
fix(server): match the ffmpeg encoder name column
1 parent b8b4bb3 commit 4d5bfcf

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/server/src/device/DeviceService.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,11 @@ describe("device setup consent", () => {
416416

417417
yield* Ref.set(encoderResult, { code: 1, stdout: "", stderr: "cannot execute ffmpeg" });
418418
expect((yield* openEmulator.pipe(Effect.flip)).message).toMatch(/ffmpeg/i);
419-
yield* Ref.set(encoderResult, { code: 0, stdout: " V....D libopenh264", stderr: "" });
419+
yield* Ref.set(encoderResult, {
420+
code: 0,
421+
stdout: " V....D libx264rgb libx264 H.264 / AVC RGB (codec h264)",
422+
stderr: "",
423+
});
420424
expect((yield* openEmulator.pipe(Effect.flip)).message).toMatch(/libx264/i);
421425
expect(requests.filter((url) => url.endsWith("/boot"))).toEqual([]);
422426
expect((yield* service.state).sessions).toEqual([physical, ios]);

‎apps/server/src/device/DeviceService.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ process.exitCode = result.error ? 1 : (result.status ?? 1);`,
689689
"Android emulator video needs working ffmpeg with the libx264 encoder. Install it on the device host's PATH or set SERVE_EMU_FFMPEG there, then retry opening the emulator. After changing PATH or SERVE_EMU_FFMPEG, turn device support off and on for SSH hosts, or restart the local environment server.",
690690
});
691691
}
692-
if (!/\blibx264\b/.test(`${encoders.stdout}\n${encoders.stderr}`)) {
692+
if (!/^\s*V\S*[ \t]+libx264(?:[ \t]|$)/m.test(`${encoders.stdout}\n${encoders.stderr}`)) {
693693
return yield* new DevicePlatformUnavailableError({
694694
hostId: host.id,
695695
platform: "android",

0 commit comments

Comments
 (0)