multihandlesink: Update current time after every write

Each write will update the last_activity_time and otherwise we would
compare against a too old current time and immediately timeout because
current time is smaller than last activity time (overflow).
This commit is contained in:
Sebastian Dröge 2013-07-28 13:20:48 +02:00
parent 43093743e5
commit 930bfe3cbc

View file

@ -1691,9 +1691,6 @@ gst_multi_handle_sink_queue_buffer (GstMultiHandleSink * mhsink,
GstMultiHandleSinkClass *mhsinkclass =
GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink);
g_get_current_time (&nowtv);
now = GST_TIMEVAL_TO_TIME (nowtv);
CLIENTS_LOCK (mhsink);
/* add buffer to queue */
g_array_prepend_val (mhsink->bufqueue, buffer);
@ -1719,6 +1716,9 @@ restart:
for (clients = mhsink->clients; clients; clients = next) {
GstMultiHandleClient *mhclient = clients->data;
g_get_current_time (&nowtv);
now = GST_TIMEVAL_TO_TIME (nowtv);
if (cookie != mhsink->clients_cookie) {
GST_DEBUG_OBJECT (sink, "Clients cookie outdated, restarting");
goto restart;