Commit 498dc9a8 authored by Josep Torra's avatar Josep Torra Committed by Olivier Crête
Browse files

shmsrc: delay fd removal until there's no uses

This fixes the remaining race condition with the fd by delaying
the removal until last pipe ref.

Unexpected critical/warning: gst_poll_fd_has_error: assertion 'fd->fd
>= 0' failed

Stack trace:
gst_debug_get_stack_trace (gstinfo.c:2788)
gst_check_log_critical_func (gstcheck.c:281)
g_logv (/lib/x86_64-linux-gnu/
g_log (/lib/x86_64-linux-gnu/
gst_poll_fd_has_error (gstpoll.c:1217)
gst_shm_src_create (gstshmsrc.c:364)
gst_push_src_create (gstpushsrc.c:131)
gst_base_src_get_range (gstbasesrc.c:2521)
gst_base_src_loop (gstbasesrc.c:2845)
gst_task_func (gsttask.c:328)
default_func (gsttaskpool.c:69)
parent eb1665ff
......@@ -277,10 +277,7 @@ gst_shm_src_stop_reading (GstShmSrc * self)
if (pipe) {
gst_shm_pipe_dec (pipe);
gst_poll_remove_fd (self->poll, &self->pollfd);
gst_poll_fd_init (&self->pollfd);
gst_poll_set_flushing (self->poll, TRUE);
......@@ -471,6 +468,10 @@ gst_shm_pipe_dec (GstShmPipe * pipe)
if (pipe->pipe)
sp_client_close (pipe->pipe);
gst_poll_remove_fd (pipe->src->poll, &pipe->src->pollfd);
gst_poll_fd_init (&pipe->src->pollfd);
GST_OBJECT_UNLOCK (pipe->src);
gst_object_unref (pipe->src);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment