mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 13:08:49 +00:00
tests: fix fdsrc test corner case
Make pipe socket non-blocking, so we don't end up being blocked in a write on the pipe while the src is eos and not reading data any more, and thus we never unblock and never notice that we're done. This would happen quite reliably on the rpi.
This commit is contained in:
parent
2e8187b178
commit
caed34f45f
1 changed files with 10 additions and 1 deletions
|
@ -87,9 +87,18 @@ GST_START_TEST (test_num_buffers)
|
|||
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
|
||||
"could not set to playing");
|
||||
|
||||
#if defined (G_OS_UNIX) && defined (O_NONBLOCK)
|
||||
{
|
||||
int flags;
|
||||
|
||||
flags = fcntl (pipe_fd[1], F_GETFL, 0);
|
||||
fcntl (pipe_fd[1], F_SETFL, flags | O_NONBLOCK);
|
||||
}
|
||||
#endif
|
||||
|
||||
memset (data, 0, 4096);
|
||||
while (!have_eos) {
|
||||
fail_if (write (pipe_fd[1], data, 4096) < 0);
|
||||
write (pipe_fd[1], data, 4096);
|
||||
g_usleep (100);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue