From: Wim Taymans Date: Wed, 23 Nov 2005 13:29:50 +0000 (+0000) Subject: gst-libs/gst/audio/gstringbuffer.c: If we are reading too slowly, jump forward in... X-Git-Tag: 1.19.3~511^2~12473 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7dc33e495aeef5a55ec8169c27d4b4a901b94a4;p=platform%2Fupstream%2Fgstreamer.git gst-libs/gst/audio/gstringbuffer.c: If we are reading too slowly, jump forward in the ringbuffer instead of blocking. Original commit message from CVS: * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_read): If we are reading too slowly, jump forward in the ringbuffer instead of blocking. --- diff --git a/ChangeLog b/ChangeLog index ecca23c..2864a91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-23 Wim Taymans + + * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_read): + If we are reading too slowly, jump forward in the ringbuffer + instead of blocking. + 2005-11-23 Jan Schmidt * ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer), diff --git a/gst-libs/gst/audio/gstringbuffer.c b/gst-libs/gst/audio/gstringbuffer.c index 2d3380a..0ac8c08 100644 --- a/gst-libs/gst/audio/gstringbuffer.c +++ b/gst-libs/gst/audio/gstringbuffer.c @@ -1183,6 +1183,12 @@ gst_ring_buffer_read (GstRingBuffer * buf, guint64 sample, guchar * data, if (diff > 0 && diff < segtotal) break; + /* flush if diff has grown bigger than ringbuffer */ + if (diff >= segtotal) { + gst_ring_buffer_clear_all (buf); + buf->segdone = readseg; + } + /* else we need to wait for the segment to become readable. */ if (!wait_segment (buf)) goto not_started;