[gst-devel] [PATCH] reset audiosrc ringbuffer

Kai Vehmanen kvehmanen at eca.cx
Wed Nov 9 10:59:34 CET 2005


Hi,

I've noticed the following strange bug:

- I run my test app:
   http://projects.collabora.co.uk/darcs/farsight/gst-plugins-farsight/tests/gsmsendrecv.c
- cause load, for example "find /usr" in a gnome-terminal (or tcpdump just
   heavy stream, this is how I found the problem)
- the send chain freezes (packets stop flowing between
   "alsasrc" and "gsmenc")

I traced the problem down to an overflow in gstringbuffer.c. The following 
patch fixed the problem (audio gets garbled, but returns to ok when I stop 
tcpdump), but I'm not 100% sure whether I'm fixing the actual bug, or just 
the symptoms. I made a few attempts to reproduce the problem with 
gst-launch, but with no success.

Anyways, it would seem that the case of 'diff >= segtotal' case should be 
handled somehow - either via error or flushing...? Currently the flow of 
packets just silently stops, and no errors are printed.

--cut--
--- gst-libs/gst/audio/gstringbuffer.c  31 Oct 2005 10:30:41 -0000      1.23
+++ gst-libs/gst/audio/gstringbuffer.c  9 Nov 2005 18:23:41 -0000
@@ -1189,6 +1189,13 @@
         * start reading the data. */
        if (diff > 0 && diff < segtotal)
          break;
+      else if (diff >= segtotal) {
+       /* diff has grown bigger than ringbuffer, flush */
+       gst_ring_buffer_clear_all(buf);
+       buf->segdone = readseg;
+      }
--cut--

--
  under work: Sofia-SIP at http://sofia-sip.sf.net




More information about the gstreamer-devel mailing list