According to the documentation, a timeout of value 0 means
that the session never timeouts. This adds handling of that.
If timeout=0 we just return with a -1 from
gst_rtsp_session_next_timeout_usec ().
https://bugzilla.gnome.org/show_bug.cgi?id=785058
#undef DEBUG
#define DEFAULT_TIMEOUT 60
#undef DEBUG
#define DEFAULT_TIMEOUT 60
#define DEFAULT_ALWAYS_VISIBLE FALSE
enum
#define DEFAULT_ALWAYS_VISIBLE FALSE
enum
+ g_mutex_lock (&priv->lock);
+ /* If timeout is set to 0, we never timeout */
+ if (priv->timeout == 0) {
+ g_mutex_unlock (&priv->lock);
+ return NO_TIMEOUT;
+ }
+ g_mutex_unlock (&priv->lock);
+
g_mutex_lock (&priv->last_access_lock);
if (g_atomic_int_get (&priv->expire_count) != 0) {
/* touch session when the expire count is not 0 */
g_mutex_lock (&priv->last_access_lock);
if (g_atomic_int_get (&priv->expire_count) != 0) {
/* touch session when the expire count is not 0 */
+GST_START_TEST (test_no_session_timeout)
+{
+ GstRTSPSession *session;
+ gint64 now;
+ gboolean is_expired;
+
+ session = gst_rtsp_session_new ("test-session");
+ gst_rtsp_session_set_timeout (session, 0);
+
+ now = g_get_monotonic_time ();
+ /* add more than the extra 5 seconds that are usually added in
+ * gst_rtsp_session_next_timeout_usec */
+ now += 7000000;
+
+ is_expired = gst_rtsp_session_is_expired_usec (session, now);
+ fail_unless (is_expired == FALSE);
+}
+
+GST_END_TEST;
+
+
GST_START_TEST (test_play_disconnect)
{
GstRTSPConnection *conn;
GST_START_TEST (test_play_disconnect)
{
GstRTSPConnection *conn;
tcase_add_test (tc, test_play_multithreaded_block_in_describe);
tcase_add_test (tc, test_play_multithreaded_timeout_client);
tcase_add_test (tc, test_play_multithreaded_timeout_session);
tcase_add_test (tc, test_play_multithreaded_block_in_describe);
tcase_add_test (tc, test_play_multithreaded_timeout_client);
tcase_add_test (tc, test_play_multithreaded_timeout_session);
+ tcase_add_test (tc, test_no_session_timeout);
tcase_add_test (tc, test_play_disconnect);
tcase_add_test (tc, test_play_specific_server_port);
tcase_add_test (tc, test_play_smpte_range);
tcase_add_test (tc, test_play_disconnect);
tcase_add_test (tc, test_play_specific_server_port);
tcase_add_test (tc, test_play_smpte_range);