summaryrefslogtreecommitdiff
path: root/gst/gstpoll.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-11-13 18:09:45 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-11-13 18:09:45 +0000
commit3cc67ebab7f2c0f8aaa825d379c8a4b6b369ffdd (patch)
tree3b17a2898c5311b87feb0c55dc0082b62a75c1ec /gst/gstpoll.c
parent2488c97ebd49147c23b9de6751ada7d101f55daa (diff)
gst/gstbuffer.c: Avoid costly typechecking for trivially correct pointers.
Original commit message from CVS: * gst/gstbuffer.c: (gst_buffer_finalize): Avoid costly typechecking for trivially correct pointers. * gst/gstpoll.c: (gst_poll_wait): Add some G_LIKELY here and there. * libs/gst/base/gstadapter.c: (gst_adapter_push): Add some debug info.
Diffstat (limited to 'gst/gstpoll.c')
-rw-r--r--gst/gstpoll.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gst/gstpoll.c b/gst/gstpoll.c
index 1c771b725..4594a10b7 100644
--- a/gst/gstpoll.c
+++ b/gst/gstpoll.c
@@ -1038,11 +1038,11 @@ gst_poll_wait (GstPoll * set, GstClockTime timeout)
g_mutex_lock (set->lock);
/* we cannot wait from multiple threads */
- if (set->waiting)
+ if (G_UNLIKELY (set->waiting))
goto already_waiting;
/* flushing, exit immediatly */
- if (set->flushing)
+ if (G_UNLIKELY (set->flushing))
goto flushing;
set->waiting = TRUE;
@@ -1208,18 +1208,19 @@ gst_poll_wait (GstPoll * set, GstClockTime timeout)
g_mutex_lock (set->lock);
+ /* FIXME, can we only do this check when (res > 0)? */
gst_poll_check_ctrl_commands (set, res, &restarting);
/* update the controllable state if needed */
set->controllable = set->new_controllable;
- if (set->flushing) {
+ if (G_UNLIKELY (set->flushing)) {
/* we got woken up and we are flushing, we need to stop */
errno = EBUSY;
res = -1;
break;
}
- } while (restarting);
+ } while (G_UNLIKELY (restarting));
set->waiting = FALSE;