mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
fpsdisplaysink: check query return result before using it
This commit is contained in:
parent
51e022d288
commit
ebc417f769
1 changed files with 4 additions and 1 deletions
|
@ -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…
Reference in a new issue