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.
This commit is contained in:
Benjamin Otte 2010-04-08 11:54:19 +02:00
parent ddfb2827d1
commit 59f2cb3cb9

View file

@ -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));