media_kit: Allow to set a NULL buffer group. Fixes #12305.
This commit is contained in:
@@ -284,9 +284,9 @@ BBufferGroup::ReclaimAllBuffers()
|
|||||||
// this has happened when the "fReclaimSem" can be aquired "fBufferCount"
|
// this has happened when the "fReclaimSem" can be aquired "fBufferCount"
|
||||||
// times
|
// times
|
||||||
|
|
||||||
status_t status;
|
status_t status = B_ERROR;
|
||||||
do {
|
do {
|
||||||
status = acquire_sem_etc(fReclaimSem, count, 0, 0);
|
status = acquire_sem_etc(fReclaimSem, count, B_RELATIVE_TIMEOUT, 0);
|
||||||
} while (status == B_INTERRUPTED);
|
} while (status == B_INTERRUPTED);
|
||||||
|
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
|
|||||||
@@ -271,11 +271,11 @@ BBufferProducer::HandleMessage(int32 message, const void* data, size_t size)
|
|||||||
? new BBufferGroup(command->buffer_count, command->buffers)
|
? new BBufferGroup(command->buffer_count, command->buffers)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
if (group == NULL || group->InitCheck() != B_OK) {
|
if (group != NULL && group->InitCheck() != B_OK) {
|
||||||
ERROR("BBufferProducer::HandleMessage PRODUCER_SET_BUFFER_GROUP"
|
ERROR("BBufferProducer::HandleMessage PRODUCER_SET_BUFFER_GROUP"
|
||||||
" group InitCheck() failed.\n");
|
" group InitCheck() failed.\n");
|
||||||
delete group;
|
delete group;
|
||||||
return B_OK;
|
group = NULL;
|
||||||
}
|
}
|
||||||
status_t status = SetBufferGroup(command->source, group);
|
status_t status = SetBufferGroup(command->source, group);
|
||||||
if (command->destination == media_destination::null)
|
if (command->destination == media_destination::null)
|
||||||
|
|||||||
Reference in New Issue
Block a user