Ticket #12730: 0001-MediaNode-WaitForMessage-Don-t-wait-for-events-in-th.patch

File 0001-MediaNode-WaitForMessage-Don-t-wait-for-events-in-th.patch, 1.6 KB (added by Barrett, 8 years ago)
  • src/kits/media/MediaEventLooper.cpp

    From 0fd5bc862e5646ddbdaca184773c0716417e9cb3 Mon Sep 17 00:00:00 2001
    From: Dario Casalinuovo <b.vitruvio@gmail.com>
    Date: Tue, 26 Apr 2016 21:08:35 +0200
    Subject: [PATCH] MediaNode::WaitForMessage: Don't wait for events in the past
    
    * Remove a workaround in BMediaEventLooper to.
    ---
     src/kits/media/MediaEventLooper.cpp | 4 ++--
     src/kits/media/MediaNode.cpp        | 7 +++++--
     2 files changed, 7 insertions(+), 4 deletions(-)
    
    diff --git a/src/kits/media/MediaEventLooper.cpp b/src/kits/media/MediaEventLooper.cpp
    index dd6e430..3674f1c 100644
    a b BMediaEventLooper::ControlLoop()  
    276276            // TODO: At boot the wait time go
    277277            // to negative depending on the system
    278278            // speed, this should be fixed.
    279             if (waitUntil < 0)
    280                 waitUntil = 0;
     279            //if (waitUntil < 0)
     280            //  waitUntil = 0;
    281281
    282282        } else if (!hasRealtime)
    283283            waitUntil = B_INFINITE_TIMEOUT;
  • src/kits/media/MediaNode.cpp

    diff --git a/src/kits/media/MediaNode.cpp b/src/kits/media/MediaNode.cpp
    index 362c3f3..b8a3add 100644
    a b BMediaNode::WaitForMessage(bigtime_t waitUntil, uint32 flags,  
    363363    ssize_t size;
    364364
    365365    while (true) {
    366         size = read_port_etc(ControlPort(), &message, data,
    367             sizeof(data), B_ABSOLUTE_TIMEOUT, waitUntil);
     366        if (TimeSource()->RealTime() < waitUntil) {
     367            size = read_port_etc(ControlPort(), &message, data,
     368                sizeof(data), B_ABSOLUTE_TIMEOUT, waitUntil);
     369        } else
     370            return B_TIMED_OUT;
    368371
    369372        if (size >= 0)
    370373            break;