audiobasesink: Handle an extra case of buffers being out of segment
authorJan Schmidt <jan@centricular.com>
Fri, 28 Sep 2018 14:49:46 +0000 (00:49 +1000)
committerSebastian Dröge <slomo@coaxion.net>
Wed, 1 Apr 2020 21:01:38 +0000 (21:01 +0000)
It's possible that a buffer might be within the segment proper,
but not within the "valid" part we're playing, which is only
things after the 'offset' part of the segment. In that case,
the running-times of the buffer-start and buffer-stop will be
GST_CLOCK_TIME_NONE, and we'd better not schedule playback that
far in the future.

gst-libs/gst/audio/gstaudiobasesink.c

index 649a5c7..7ce15cd 100644 (file)
@@ -1989,6 +1989,9 @@ gst_audio_base_sink_render (GstBaseSink * bsink, GstBuffer * buf)
   render_stop =
       gst_segment_to_running_time (&bsink->segment, GST_FORMAT_TIME, stop);
 
+  if (render_start == GST_CLOCK_TIME_NONE || render_stop == GST_CLOCK_TIME_NONE)
+    goto too_late;
+
   GST_DEBUG_OBJECT (sink,
       "running: start %" GST_TIME_FORMAT " - stop %" GST_TIME_FORMAT,
       GST_TIME_ARGS (render_start), GST_TIME_ARGS (render_stop));