fpsdisplaysink: check query return result before using it
This commit is contained in:
parent
51e022d288
commit
ebc417f769
@ -206,7 +206,10 @@ display_current_fps (gpointer data)
|
|||||||
GstFPSDisplaySink *self = GST_FPS_DISPLAY_SINK (data);
|
GstFPSDisplaySink *self = GST_FPS_DISPLAY_SINK (data);
|
||||||
gint64 current_ts;
|
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);
|
gst_query_parse_position (self->query, NULL, ¤t_ts);
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (self->last_ts)) {
|
if (GST_CLOCK_TIME_IS_VALID (self->last_ts)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user