--- gst-plugins-good-0.10.4/sys/sunaudio/gstsunaudiosink.c-orig	2006-11-27 15:31:20.547804000 -0600
+++ gst-plugins-good-0.10.4/sys/sunaudio/gstsunaudiosink.c	2006-11-27 15:31:31.945555000 -0600
@@ -42,6 +42,7 @@
 
 #include <fcntl.h>
 #include <string.h>
+#include <stropts.h>
 #include <unistd.h>
 #include <sys/mman.h>
 
@@ -390,4 +391,45 @@ gst_sunaudiosink_delay (GstAudioSink * a
 static void
 gst_sunaudiosink_reset (GstAudioSink * asink)
 {
+  /* Get current values */
+  GstSunAudioSink *sunaudiosink = GST_SUNAUDIO_SINK (asink);
+  audio_info_t ainfo;
+  int ret;
+
+  ret = ioctl (sunaudiosink->fd, AUDIO_GETINFO, &ainfo);
+  if (ret == -1) {
+    /*
+     * Should never happen, but if we couldn't getinfo, then no point
+     * trying to setinfo
+     */
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+    return;
+  }
+
+  /*
+   * Pause the audio - so audio stops playing immediately rather than
+   * waiting for the ringbuffer to empty.
+   */
+  ainfo.play.pause = !NULL;
+  ret = ioctl (sunaudiosink->fd, AUDIO_SETINFO, &ainfo);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+  }
+
+  /* Flush the audio */
+  ret = ioctl(sunaudiosink->fd, I_FLUSH, FLUSHW);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+  }
+
+  /* unpause the audio */
+  ainfo.play.pause = NULL;
+  ret = ioctl (sunaudiosink->fd, AUDIO_SETINFO, &ainfo);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+  }
 }
--- gst-plugins-good-0.10.4/sys/sunaudio/gstsunaudiosrc.c-orig	2006-11-27 15:33:27.137164000 -0600
+++ gst-plugins-good-0.10.4/sys/sunaudio/gstsunaudiosrc.c	2006-11-27 15:35:11.133518000 -0600
@@ -398,5 +398,45 @@ gst_sunaudiosrc_delay (GstAudioSrc * asr
 static void
 gst_sunaudiosrc_reset (GstAudioSrc * asrc)
 {
-  return;
+  /* Get current values */
+  GstSunAudioSrc *sunaudiosrc = GST_SUNAUDIO_SRC (asrc);
+  audio_info_t ainfo;
+  int ret;
+
+  ret = ioctl (sunaudiosrc->fd, AUDIO_GETINFO, &ainfo);
+  if (ret == -1) {
+    /*
+     * Should never happen, but if we couldn't getinfo, then no point
+     * trying to setinfo
+     */
+    GST_ELEMENT_ERROR (sunaudiosrc, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+    return;
+  }
+
+  /*
+   * Pause the audio - so audio stops playing immediately rather than
+   * waiting for the ringbuffer to empty.
+   */
+  ainfo.record.pause = !NULL;
+  ret = ioctl (sunaudiosrc->fd, AUDIO_SETINFO, &ainfo);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosrc, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+  }
+
+  /* Flush the audio */
+  ret = ioctl(sunaudiosrc->fd, I_FLUSH, FLUSHR);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosrc, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+  }
+
+  /* unpause the audio */
+  ainfo.record.pause = NULL;
+  ret = ioctl (sunaudiosrc->fd, AUDIO_SETINFO, &ainfo);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosrc, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+  }
 }
