diff --git a/include/pipewire_video.h b/include/pipewire_video.h index 8722d21..38ec3d6 100644 --- a/include/pipewire_video.h +++ b/include/pipewire_video.h @@ -112,6 +112,7 @@ typedef struct { bool paused; double paused_start_secs; + bool streaming; gsr_monitor_rotation rotation; } gsr_pipewire_video; diff --git a/src/pipewire_video.c b/src/pipewire_video.c index a09e39f..eb7d3b0 100644 --- a/src/pipewire_video.c +++ b/src/pipewire_video.c @@ -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; }