From ae9cbf9c4e167470b47964059e90c2b0881367eb Mon Sep 17 00:00:00 2001 From: Dario Casalinuovo Date: Tue, 25 Aug 2015 22:58:18 +0200 Subject: [PATCH] MediaNode: Wait for 0 time if the absolute timeout is in the past --- src/kits/media/MediaNode.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kits/media/MediaNode.cpp b/src/kits/media/MediaNode.cpp index bece94a000..ab68d927f5 100644 --- a/src/kits/media/MediaNode.cpp +++ b/src/kits/media/MediaNode.cpp @@ -343,6 +343,10 @@ BMediaNode::WaitForMessage(bigtime_t waitUntil, uint32 flags, char data[B_MEDIA_MESSAGE_SIZE]; int32 message; ssize_t size; + + if (waitUntil < TimeSource()->RealTime()) + waitUntil = 0; + while (true) { size = read_port_etc(ControlPort(), &message, data, sizeof(data), B_ABSOLUTE_TIMEOUT, waitUntil);