media_kit: Allow to set a NULL buffer group. Fixes #12305.

This commit is contained in:
Dario Casalinuovo
2015-09-26 13:23:48 +02:00
parent 7e26adffc0
commit 8bffda1633
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -284,9 +284,9 @@ BBufferGroup::ReclaimAllBuffers()
// this has happened when the "fReclaimSem" can be aquired "fBufferCount"
// times
status_t status;
status_t status = B_ERROR;
do {
status = acquire_sem_etc(fReclaimSem, count, 0, 0);
status = acquire_sem_etc(fReclaimSem, count, B_RELATIVE_TIMEOUT, 0);
} while (status == B_INTERRUPTED);
if (status != B_OK)
+2 -2
View File
@@ -271,11 +271,11 @@ BBufferProducer::HandleMessage(int32 message, const void* data, size_t size)
? new BBufferGroup(command->buffer_count, command->buffers)
: NULL;
if (group == NULL || group->InitCheck() != B_OK) {
if (group != NULL && group->InitCheck() != B_OK) {
ERROR("BBufferProducer::HandleMessage PRODUCER_SET_BUFFER_GROUP"
" group InitCheck() failed.\n");
delete group;
return B_OK;
group = NULL;
}
status_t status = SetBufferGroup(command->source, group);
if (command->destination == media_destination::null)