mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rtsp: make timeout usec more accurate
Adjust the returned usec from the elapsed time so it represents the remaining timeout.
This commit is contained in:
parent
412e5f5871
commit
2221e404de
1 changed files with 6 additions and 2 deletions
|
@ -2481,6 +2481,10 @@ gst_rtsp_connection_next_timeout (GstRTSPConnection * conn, GTimeVal * timeout)
|
||||||
usec = 0;
|
usec = 0;
|
||||||
} else {
|
} else {
|
||||||
sec = conn->timeout - elapsed;
|
sec = conn->timeout - elapsed;
|
||||||
|
if (usec <= G_USEC_PER_SEC)
|
||||||
|
usec = G_USEC_PER_SEC - usec;
|
||||||
|
else
|
||||||
|
usec = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout->tv_sec = sec;
|
timeout->tv_sec = sec;
|
||||||
|
|
Loading…
Reference in a new issue