How to generate error message when there is an internal read error in one of the object in a pipeline

tanmay.ambre ambre.tanmay at
Mon May 21 10:58:51 PDT 2012

I am using directsoundsrc plugin. Windows OSSBuild.

There is a gst_directsound_src_read function which has a while loop reading
buffers from the device.

When I accidently unplug the device I found this while loop went into an
infinite loop. I fixed it partially.

I can detect when there is error in capture.

What I have not figured out is now how to make the pipeline stop.

while (length > dwBufferSize) {
    Sleep (dsoundsrc->latency_time / 1000);
    hRes =
        &dwCurrentCaptureCursor, NULL);
	if (hRes != 0)
			GST_ERROR("\nDevice Error HRESULT = %i",hRes)	;///This is where i can
detect an error
    /* calculate the buffer */
    if (dwCurrentCaptureCursor < dsoundsrc->current_circular_offset) {
      dwBufferSize = dsoundsrc->buffer_size -
          (dsoundsrc->current_circular_offset - dwCurrentCaptureCursor);
    } else {
      dwBufferSize =
          dwCurrentCaptureCursor - dsoundsrc->current_circular_offset;

Any suggestions.?????


View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list