pipewire video: fail video map texture if state is not streaming

Fixes portal capture failing on some systems
This commit is contained in:
dec05eba
2026-03-01 19:30:13 +01:00
parent 6079a0162d
commit fd08cdb9b4
2 changed files with 3 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ typedef struct {
bool paused;
double paused_start_secs;
bool streaming;
gsr_monitor_rotation rotation;
} gsr_pipewire_video;

View File

@@ -348,6 +348,7 @@ static void on_state_changed_cb(void *user_data, enum pw_stream_state prev_state
} else {
self->paused = false;
}
self->streaming = (new_state == PW_STREAM_STATE_STREAMING);
pthread_mutex_unlock(&self->mutex);
}
@@ -858,7 +859,7 @@ bool gsr_pipewire_video_map_texture(gsr_pipewire_video *self, gsr_texture_map te
output->rotation = GSR_MONITOR_ROT_0;
pthread_mutex_lock(&self->mutex);
if(!self->negotiated || self->dmabuf_data[0].fd <= 0) {
if(!self->negotiated || !self->streaming || self->dmabuf_data[0].fd <= 0) {
pthread_mutex_unlock(&self->mutex);
return false;
}