When we quickly switch from PLAYING to PAUSED and back to PLAYING it's possible
in some cases that the task refuses to start, This is because when we go to
PAUSED, we unschedule the clock timeout, which could return UNSCHEDULED when
we're back to PLAYING, causing the task to PAUSE again with a wrong-state.
This patch checks if we are running when we return with an UNSCHEDULED return
value and if we are, try to create a new buffer.
Fixes#597550
This is slightly more efficient because the compiler can't do tail
recursion here and has to keep all stack frames.
Not that efficiency is that important here but I already had
the iterative version somewhere else and both are easy to read.
This test used to SIGBUS on OS/X but now SIGSEGV's instead on
Snow Leopard. It's not worth the effort to figure out which platform
should produce which error for what is fundamentally a pretty silly
test, so just disable it on OS/X
This allows the macosx versions to properly error out when fds are closed.
This is only a temporary fix until the pluginloader is switched to not
use GstPoll but GIOChannels.
In the plugin loader subprocess, move stdin and stdout to new fd's
so that plugins printing things during plugin init or (*gasp*)
possibly reading from stdin don't interfere with the data sent to
and from the parent.
When the plugin-scanner load fails (because the helper can't be
spawned), make sure to load the plugin that failed in-process, so
that all plugins do get loaded.
Split gst_queue_locked_enqueue() into variant for buffer and event to get rid of
the if() and make the code more readable (constant boolean parameters are never
nice). Removes the if (item) checks as we dereference the pointer before anyway.
Also apply the same idea of reusing the previous knowledge in
gst_queue_locked_dequeue to remove more type checks.
The code was previously:
* checking if ret was != OK
* .. but if it was FLOW_STEP, swith it to OK
* .. and then not using ret
Instead we just make it more compact by checking if it's OK or STEP.
Fix an off-by-one error in the size guard for unpack_element, and
improve various debug statements in the failure paths.
Also, swap some g_new0 to g_malloc0 for the fun of it.