From 3a73ca478689be34a8f6cffb7b7b6ea43ceea7cb Mon Sep 17 00:00:00 2001 From: Mr-Z-2697 <74594146+mr-z-2...@users.noreply.github.com> Date: Wed, 7 May 2025 23:15:57 +0800 Subject: [PATCH] Fix inputs for Windows named pipe --- source/input/y4m.cpp | 8 ++++++++ source/input/yuv.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/source/input/y4m.cpp b/source/input/y4m.cpp index 186499bd1..4b371e1ba 100644 --- a/source/input/y4m.cpp +++ b/source/input/y4m.cpp @@ -109,7 +109,11 @@ Y4MInput::Y4MInput(InputFileInfo& info, bool alpha, int format) info.frameCount = -1; size_t estFrameSize = framesize + sizeof(header) + 1; /* assume basic FRAME\n headers */ /* try to estimate frame count, if this is not stdin */ +#if _WIN32 + if (ifs != stdin && strncmp(info.filename, "\\\\.\\pipe\\", 9)) +#else if (ifs != stdin) +#endif { int64_t cur = ftello(ifs); if (cur >= 0) @@ -123,7 +127,11 @@ Y4MInput::Y4MInput(InputFileInfo& info, bool alpha, int format) } if (info.skipFrames) { +#if _WIN32 + if (ifs != stdin && strncmp(info.filename, "\\\\.\\pipe\\", 9)) +#else if (ifs != stdin) +#endif fseeko(ifs, (int64_t)estFrameSize * info.skipFrames, SEEK_CUR); else for (int i = 0; i < info.skipFrames; i++) diff --git a/source/input/yuv.cpp b/source/input/yuv.cpp index c13b4f375..8afc75545 100644 --- a/source/input/yuv.cpp +++ b/source/input/yuv.cpp @@ -104,7 +104,11 @@ YUVInput::YUVInput(InputFileInfo& info, bool alpha, int format) info.frameCount = -1; /* try to estimate frame count, if this is not stdin */ +#if _WIN32 + if (ifs != stdin && strncmp(info.filename, "\\\\.\\pipe\\", 9)) +#else if (ifs != stdin) +#endif { int64_t cur = ftello(ifs); if (cur >= 0) @@ -118,7 +122,11 @@ YUVInput::YUVInput(InputFileInfo& info, bool alpha, int format) } if (info.skipFrames) { +#if _WIN32 + if (ifs != stdin && strncmp(info.filename, "\\\\.\\pipe\\", 9)) +#else if (ifs != stdin) +#endif fseeko(ifs, (int64_t)framesize * info.skipFrames, SEEK_CUR); else for (int i = 0; i < info.skipFrames; i++) -- 2.49.0
0001-Fix-inputs-for-Windows-named-pipe.patch
Description: Binary data
_______________________________________________ x265-devel mailing list x265-devel@videolan.org https://mailman.videolan.org/listinfo/x265-devel