start node at correct performance time

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3391 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper 2003-05-30 20:41:04 +00:00
parent 1ab3e01897
commit 2bff4d995e

View File

@ -152,16 +152,12 @@ BSoundPlayer::Start()
return B_ERROR;
}
BTimeSource *timeSource = roster->MakeTimeSourceFor(_m_node->Node());
// make sure we give the producer enough time to run buffers through
// the node chain, otherwise it'll start up already late
bigtime_t latency = 0;
status_t err = roster->GetLatencyFor(_m_node->Node(), &latency);
err = roster->StartNode(_m_node->Node(), timeSource->Now() + latency + 5000);
timeSource->Release();
err = roster->StartNode(_m_node->Node(), _m_node->TimeSource()->Now() + latency + 5000);
return err;
}