plugins/screencast: Avoid closing dmabuf fds twice

dmabuf fds are owned by the GraphicsBuffer, which will be destroyed when
`m_dmabufDataForPwBuffer.remove(buffer);` is executed.
This commit is contained in:
Vlad Zahorodnii 2024-03-18 15:28:24 +02:00
parent 0897dbff75
commit fb7dd07076

View file

@ -292,10 +292,6 @@ void ScreenCastStream::onStreamRemoveBuffer(pw_buffer *buffer)
if (spa_data && spa_data->type == SPA_DATA_MemFd) { if (spa_data && spa_data->type == SPA_DATA_MemFd) {
munmap(spa_data->data, spa_data->maxsize); munmap(spa_data->data, spa_data->maxsize);
close(spa_data->fd); close(spa_data->fd);
} else if (spa_data && spa_data->type == SPA_DATA_DmaBuf) {
for (int i = 0, c = buffer->buffer->n_datas; i < c; ++i) {
close(buffer->buffer->datas[i].fd);
}
} }
} }