From 4b95b38c0a2f984fce24af2e6fa717549df9c9d5 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 12 Oct 2016 01:35:13 -0700 Subject: [PATCH] capture-cursor: skip when no read delegate was found If we were skipping due to no matching read delegate, then we can just ignore any checks on that frame and move to the next. --- lib/sp-capture-cursor.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sp-capture-cursor.c b/lib/sp-capture-cursor.c index 2a58af5a..3b98237c 100644 --- a/lib/sp-capture-cursor.c +++ b/lib/sp-capture-cursor.c @@ -80,7 +80,7 @@ sp_capture_cursor_foreach (SpCaptureCursor *self, { const SpCaptureFrame *frame; SpCaptureFrameType type = 0; - ReadDelegate delegate; + ReadDelegate delegate = NULL; if (!sp_capture_reader_peek_type (self->reader, &type)) return; @@ -130,7 +130,10 @@ sp_capture_cursor_foreach (SpCaptureCursor *self, break; } - if (delegate != NULL && NULL == (frame = delegate (self->reader))) + if (delegate == NULL) + continue; + + if (NULL == (frame = delegate (self->reader))) return; if (self->conditions->len == 0)