diff --git a/gstdirectsoundsrc.c b/gstdirectsoundsrc.c
index 11063ca..df80a52 100755
--- a/gstdirectsoundsrc.c
+++ b/gstdirectsoundsrc.c
@@ -534,7 +534,7 @@ gst_directsound_src_read (GstAudioSrc * asrc, gpointer data, guint length,
       &dwStatus);
 
   /* Starting capturing if not already */
-  if (!(dwStatus & DSCBSTATUS_CAPTURING)) {
+  if (SUCCEEDED (hRes) && !(dwStatus & DSCBSTATUS_CAPTURING)) {
     hRes = IDirectSoundCaptureBuffer_Start (dsoundsrc->pDSBSecondary,
         DSCBSTART_LOOPING);
     //    Sleep (dsoundsrc->latency_time/1000);
@@ -548,6 +548,11 @@ gst_directsound_src_read (GstAudioSrc * asrc, gpointer data, guint length,
         IDirectSoundCaptureBuffer_GetCurrentPosition (dsoundsrc->pDSBSecondary,
         &dwCurrentCaptureCursor, NULL);
 
+    if (hRes != DS_OK)
+    {
+        GST_DSOUND_UNLOCK (dsoundsrc);
+        return -1;
+    }
     /* calculate the buffer */
     if (dwCurrentCaptureCursor < dsoundsrc->current_circular_offset) {
       dwBufferSize = dsoundsrc->buffer_size -
