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,13 +648,17 @@ gst_shout2send_render (GstBaseSink * basesink, GstBuffer * buf)
delay = shout_delay (sink->conn);
GST_LOG_OBJECT (sink, "waiting %d msec", delay);
if (gst_poll_wait (sink->timer, GST_MSECOND * delay) == -1) {
GST_LOG_OBJECT (sink, "unlocked");
fret = gst_base_sink_wait_preroll (basesink);
if (fret != GST_FLOW_OK)
return fret;
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");
fret = gst_base_sink_wait_preroll (basesink);
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));
......
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