Always wait for buffers in AudioProducer::_FillNextBuffer().
Seems to work around a problem in the system mixer. When it happens once that the AudioProducer does not send a buffer, then it can eventually lead to a drop into the debugger from BBuffer::SetHeader(), which to me looks like the BMediaEventLooper thread of the mixer still runs when the System Mixer has been shut down, which itself is yet another problem. I shall investigate, but for the time being, one should enjoy a more stable media_addon_server life-time. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38664 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8eb72c7217
commit
05e6afd6ea
@ -645,13 +645,13 @@ printf("B_START: start time: %lld\n", fStartTime);
|
||||
if (RunState() == BMediaEventLooper::B_STARTED
|
||||
&& fOutput.destination != media_destination::null) {
|
||||
BBuffer* buffer = _FillNextBuffer(event->event_time);
|
||||
if (buffer) {
|
||||
if (buffer != NULL) {
|
||||
status_t err = B_ERROR;
|
||||
if (fOutputEnabled) {
|
||||
err = SendBuffer(buffer, fOutput.source,
|
||||
fOutput.destination);
|
||||
}
|
||||
if (err)
|
||||
if (err != B_OK)
|
||||
buffer->Recycle();
|
||||
}
|
||||
size_t sampleSize = fOutput.format.u.raw_audio.format
|
||||
@ -810,6 +810,7 @@ AudioProducer::_AllocateBuffers(const media_format& format)
|
||||
BBuffer*
|
||||
AudioProducer::_FillNextBuffer(bigtime_t eventTime)
|
||||
{
|
||||
fBufferGroup->WaitForBuffers();
|
||||
BBuffer* buffer = fBufferGroup->RequestBuffer(
|
||||
fOutput.format.u.raw_audio.buffer_size, BufferDuration());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user