Commit 59f2cb3c authored by Benjamin Otte's avatar Benjamin Otte

shout2: Don't wait if we're late

In fact, due to signedness issues, a negative delay would be changed to
an almost infinite wait causing shout2send to "lock up".

Reported by Christopher Montgomery.
parent ddfb2827
......@@ -648,6 +648,7 @@ gst_shout2send_render (GstBaseSink * basesink, GstBuffer * buf)
delay = shout_delay (sink->conn);
if (delay > 0) {
GST_LOG_OBJECT (sink, "waiting %d msec", delay);
if (gst_poll_wait (sink->timer, GST_MSECOND * delay) == -1) {
GST_LOG_OBJECT (sink, "unlocked");
......@@ -656,6 +657,9 @@ gst_shout2send_render (GstBaseSink * basesink, GstBuffer * buf)
if (fret != GST_FLOW_OK)
return fret;
}
} else {
GST_LOG_OBJECT (sink, "we're %d msec late", -delay);
}
GST_LOG_OBJECT (sink, "sending %u bytes of data", GST_BUFFER_SIZE (buf));
ret = shout_send (sink->conn, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment