pthread_mutex_lock(&idx_lock);
- if (!bo->current_stream) {
- idx = append_bo(stream, bo);
- bo->current_stream = stream;
- bo->idx = idx;
- } else if (bo->current_stream == stream) {
+ if (bo->current_stream == stream) {
idx = bo->idx;
} else {
/* slow-path: */
/* not found */
idx = append_bo(stream, bo);
}
+ bo->current_stream = stream;
+ bo->idx = idx;
}
pthread_mutex_unlock(&idx_lock);