mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
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:
parent
ddfb2827d1
commit
59f2cb3cb9
1 changed files with 10 additions and 6 deletions
|
@ -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");
|
||||
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;
|
||||
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));
|
||||
|
|
Loading…
Reference in a new issue