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 gmail.com
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 =
        IDirectSoundCaptureBuffer_GetCurrentPosition
(dsoundsrc->pDSBSecondary,
        &dwCurrentCaptureCursor, NULL);
	if (hRes != 0)
	{
			GST_ERROR("\nDevice Error HRESULT = %i",hRes)	;///This is where i can
detect an error
break;
	}
		
    /* 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.?????

Tanmay


--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-generate-error-message-when-there-is-an-internal-read-error-in-one-of-the-object-in-a-pipeline-tp4648532.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list