From ebc417f769bffd7eaca260eac5358f953551868c Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 20 Jul 2009 16:20:15 +0300 Subject: fpsdisplaysink: check query return result before using it --- gst/debugutils/fpsdisplaysink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gst/debugutils') diff --git a/gst/debugutils/fpsdisplaysink.c b/gst/debugutils/fpsdisplaysink.c index 54f5cc54..ff3e0dfd 100644 --- a/gst/debugutils/fpsdisplaysink.c +++ b/gst/debugutils/fpsdisplaysink.c @@ -206,7 +206,10 @@ display_current_fps (gpointer data) GstFPSDisplaySink *self = GST_FPS_DISPLAY_SINK (data); gint64 current_ts; - gst_element_query (self->video_sink, self->query); + /* if query failed try again on next timer tick */ + if (!gst_element_query (self->video_sink, self->query)) + return TRUE; + gst_query_parse_position (self->query, NULL, ¤t_ts); if (GST_CLOCK_TIME_IS_VALID (self->last_ts)) { -- cgit v1.2.1