BSoundPlayer changes:
* calls the notifier in Start() and Stop() * calls SetHasData() with true in Start() like BeOS does * starts the timesource if not running in Start() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29012 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -335,6 +335,11 @@ BSoundPlayer::Start()
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!fPlayerNode->TimeSource()->IsRunning()) {
|
||||||
|
roster->StartTimeSource(fPlayerNode->TimeSource()->Node(),
|
||||||
|
fPlayerNode->TimeSource()->RealTime());
|
||||||
|
}
|
||||||
|
|
||||||
// Add latency and a few ms to the nodes current time to
|
// Add latency and a few ms to the nodes current time to
|
||||||
// make sure that we give the producer enough time to run
|
// make sure that we give the producer enough time to run
|
||||||
// buffers through the node chain, otherwise it'll start
|
// buffers through the node chain, otherwise it'll start
|
||||||
@@ -346,6 +351,10 @@ BSoundPlayer::Start()
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fNotifierFunc)
|
||||||
|
fNotifierFunc(fCookie, B_STARTED, this);
|
||||||
|
|
||||||
|
SetHasData(true);
|
||||||
atomic_or(&fFlags, F_IS_STARTED);
|
atomic_or(&fFlags, F_IS_STARTED);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -389,6 +398,10 @@ BSoundPlayer::Stop(bool block,
|
|||||||
// wait until all buffers on the way to the physical output have been played
|
// wait until all buffers on the way to the physical output have been played
|
||||||
snooze(Latency() + 2000);
|
snooze(Latency() + 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fNotifierFunc)
|
||||||
|
fNotifierFunc(fCookie, B_STOPPED, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user