title: gstreamer 0.10: flush pipeline buffers
body: <p>On the application I'm working on, which uses Gstreamer 0.10, we receive streaming audio data from a TCP socket (from another process running locally).</p>
  
  <p>We can issue "seek" command to the process, which is working: we start receiving data corresponding the new position we specify.</p>
  
  <p>So far so good.</p>
  
  <p>However, there is delay between the time we issue the seek and the time we start playing the data at the correct position.</p>
  
  <p>I'm pretty sure this is because we buffer data.</p>
  
  <p>So I would like to flush the data buffered in our pipeline when we issue the seek command.</p>
  
  <p>However, I didn't managed to do this: I used gst_pad_push_event (gst_event_new_flush_start()) on the pad, then gst_event_new_flush_stop short after, which both return TRUE.</p>
  
  <p>However, music stops, and never start again.</p>
  
  <p>Using export <code>GST_DEBUG=2</code> I can see the following warning:</p>
  
  <p><code>gdpdepay gstgdpdepay.c:429:gst_gdp_depay_chain:&lt;gdpdepay-1&gt; pushing depayloaded buffer returned -2</code></p>
  
  <p>As the other process continue to push data while flush might be "on" for a short amount of time, that might explain this warning. But I would expect the other process to be able to continue to push data, and our pipeline to be able to continue to read data from this socket and process them in the pipeline, after sending a flush_stop event.</p>
  
  <p>Googling this issue, I found some suggestions like changing the pipeline state, but that didn't help either.</p>
  
  <p>Any help very welcome!</p>