diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c
index 6336db5..c8ecada 100644
--- a/gst/audioresample/gstaudioresample.c
+++ b/gst/audioresample/gstaudioresample.c
@@ -63,7 +63,8 @@ enum
 {
   PROP_0,
   PROP_QUALITY,
-  PROP_FILTER_LENGTH
+  PROP_FILTER_LENGTH,
+  PROP_GAP_AWARE
 };
 
 #define SUPPORTED_CAPS \
@@ -193,6 +194,12 @@ gst_audio_resample_class_init (GstAudioResampleClass * klass)
       g_param_spec_int ("filter-length", "Filter length",
           "Length of the resample filter", 0, G_MAXINT, 64, G_PARAM_READWRITE));
 
+  g_object_class_install_property (gobject_class, PROP_GAP_AWARE,
+      g_param_spec_boolean ("gap-aware", "Gap Aware", "true = skip buffers " \
+          "flagged as gaps;  false = process all buffers. " \
+          "This only works for upsampling.", FALSE,
+          G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
   GST_BASE_TRANSFORM_CLASS (klass)->start =
       GST_DEBUG_FUNCPTR (gst_audio_resample_start);
   GST_BASE_TRANSFORM_CLASS (klass)->stop =
@@ -974,6 +981,9 @@ gst_audio_resample_process (GstAudioResample * resample, GstBuffer * inbuf,
   guint32 out_len, out_processed;
   gint err;
 
+  /* variables to handle gap support */
+  gboolean skip_gap;
+
   in_len = GST_BUFFER_SIZE (inbuf) / resample->channels;
   out_len = GST_BUFFER_SIZE (outbuf) / resample->channels;
 
@@ -983,6 +993,9 @@ gst_audio_resample_process (GstAudioResample * resample, GstBuffer * inbuf,
   in_processed = in_len;
   out_processed = out_len;
 
+  /* FIXME gap support only works for upsampling */
+  skip_gap = resample->gap_aware && GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP) && (resample->outrate > resample->inrate);
+
   if (resample->funcs->width != resample->width) {
     /* need to convert data format for processing;  ensure we have enough
      * workspace available */
@@ -1000,18 +1013,41 @@ gst_audio_resample_process (GstAudioResample * resample, GstBuffer * inbuf,
     gst_audio_resample_convert_buffer (resample, GST_BUFFER_DATA (inbuf),
         resample->tmp_in, in_len, FALSE);
 
-    /* process */
-    err = resample->funcs->process (resample->state,
-        resample->tmp_in, &in_processed, resample->tmp_out, &out_processed);
+    /* process only if we have don't have a GAP 
+     * otherwise memset the output to 0 */
+    if (skip_gap) {
+      GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_GAP);
+      memset (GST_BUFFER_DATA (outbuf), 0, GST_BUFFER_SIZE (outbuf));
+      err = 0;
+    } else {
+      GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_GAP);
+      err = resample->funcs->process (resample->state,
+          resample->tmp_in, &in_processed, resample->tmp_out, &out_processed);
+    }
 
     /* convert output */
     gst_audio_resample_convert_buffer (resample, resample->tmp_out,
         GST_BUFFER_DATA (outbuf), out_processed, TRUE);
   } else {
     /* no format conversion required;  process */
-    err = resample->funcs->process (resample->state,
-        GST_BUFFER_DATA (inbuf), &in_processed,
-        GST_BUFFER_DATA (outbuf), &out_processed);
+    /* process only if we have don't have a GAP 
+     * otherwise memset the output to 0 */
+    if (skip_gap) {
+      GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_GAP);
+      memset (GST_BUFFER_DATA (outbuf), 0, GST_BUFFER_SIZE (outbuf));
+      err = 0;
+    } else {
+      GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_GAP);
+      err = resample->funcs->process (resample->state,
+          GST_BUFFER_DATA (inbuf), &in_processed,
+          GST_BUFFER_DATA (outbuf), &out_processed);
+    }
+  }
+
+  if (skip_gap) {
+    gst_audio_resample_push_drain (resample);
+    gst_audio_resample_reset_state (resample);
+    resample->funcs->skip_zeros(resample->state);
   }
 
   /* If we wrote more than allocated something is really wrong now and we
@@ -1278,6 +1314,15 @@ gst_audio_resample_set_property (GObject * object, guint prop_id,
       GST_BASE_TRANSFORM_UNLOCK (resample);
       break;
     }
+    case PROP_GAP_AWARE:
+      GST_BASE_TRANSFORM_LOCK (resample);
+      /* FIXME:  too bad we need to record our own copy of this, why
+       * doesn't basetransform expose its flag? */
+      resample->gap_aware = g_value_get_boolean (value);
+      gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM (resample),
+          resample->gap_aware);
+      GST_BASE_TRANSFORM_UNLOCK (resample);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1333,6 +1378,9 @@ gst_audio_resample_get_property (GObject * object, guint prop_id,
           break;
       }
       break;
+    case PROP_GAP_AWARE:
+      g_value_set_boolean (value, resample->gap_aware);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
diff --git a/gst/audioresample/gstaudioresample.h b/gst/audioresample/gstaudioresample.h
index 2f41b2c..046e175 100644
--- a/gst/audioresample/gstaudioresample.h
+++ b/gst/audioresample/gstaudioresample.h
@@ -64,6 +64,7 @@ struct _GstAudioResample {
   guint64 next_in_offset;
   guint64 next_out_offset;
   
+  gboolean gap_aware;
   gint channels;
   gint inrate;
   gint outrate;
diff --git a/gst/audioresample/speex_resampler_wrapper.h b/gst/audioresample/speex_resampler_wrapper.h
index 36d444f..e15eb2c 100644
--- a/gst/audioresample/speex_resampler_wrapper.h
+++ b/gst/audioresample/speex_resampler_wrapper.h
@@ -52,6 +52,7 @@ typedef struct {
   void (*get_ratio) (SpeexResamplerState * st,
     guint32 * ratio_num, guint32 * ratio_den);
   int (*get_input_latency) (SpeexResamplerState * st);
+  int (*get_output_latency) (SpeexResamplerState * st);
   int (*set_quality) (SpeexResamplerState * st, gint quality);
   int (*reset_mem) (SpeexResamplerState * st);
   int (*skip_zeros) (SpeexResamplerState * st);
@@ -71,6 +72,7 @@ void resample_float_resampler_get_rate (SpeexResamplerState * st,
 void resample_float_resampler_get_ratio (SpeexResamplerState * st,
     guint32 * ratio_num, guint32 * ratio_den);
 int resample_float_resampler_get_input_latency (SpeexResamplerState * st);
+int resample_float_resampler_get_output_latency (SpeexResamplerState *st);
 int resample_float_resampler_set_quality (SpeexResamplerState * st, gint quality);
 int resample_float_resampler_reset_mem (SpeexResamplerState * st);
 int resample_float_resampler_skip_zeros (SpeexResamplerState * st);
@@ -85,6 +87,7 @@ static const SpeexResampleFuncs float_funcs =
   resample_float_resampler_get_rate,
   resample_float_resampler_get_ratio,
   resample_float_resampler_get_input_latency,
+  resample_float_resampler_get_output_latency,
   resample_float_resampler_set_quality,
   resample_float_resampler_reset_mem,
   resample_float_resampler_skip_zeros,
@@ -104,6 +107,7 @@ void resample_double_resampler_get_rate (SpeexResamplerState * st,
 void resample_double_resampler_get_ratio (SpeexResamplerState * st,
     guint32 * ratio_num, guint32 * ratio_den);
 int resample_double_resampler_get_input_latency (SpeexResamplerState * st);
+int resample_double_resampler_get_output_latency (SpeexResamplerState *st);
 int resample_double_resampler_set_quality (SpeexResamplerState * st, gint quality);
 int resample_double_resampler_reset_mem (SpeexResamplerState * st);
 int resample_double_resampler_skip_zeros (SpeexResamplerState * st);
@@ -118,6 +122,7 @@ static const SpeexResampleFuncs double_funcs =
   resample_double_resampler_get_rate,
   resample_double_resampler_get_ratio,
   resample_double_resampler_get_input_latency,
+  resample_double_resampler_get_output_latency,
   resample_double_resampler_set_quality,
   resample_double_resampler_reset_mem,
   resample_double_resampler_skip_zeros,
@@ -137,6 +142,7 @@ void resample_int_resampler_get_rate (SpeexResamplerState * st,
 void resample_int_resampler_get_ratio (SpeexResamplerState * st,
     guint32 * ratio_num, guint32 * ratio_den);
 int resample_int_resampler_get_input_latency (SpeexResamplerState * st);
+int resample_int_resampler_get_output_latency (SpeexResamplerState * st);
 int resample_int_resampler_set_quality (SpeexResamplerState * st, gint quality);
 int resample_int_resampler_reset_mem (SpeexResamplerState * st);
 int resample_int_resampler_skip_zeros (SpeexResamplerState * st);
@@ -151,6 +157,7 @@ static const SpeexResampleFuncs int_funcs =
   resample_int_resampler_get_rate,
   resample_int_resampler_get_ratio,
   resample_int_resampler_get_input_latency,
+  resample_int_resampler_get_output_latency,
   resample_int_resampler_set_quality,
   resample_int_resampler_reset_mem,
   resample_int_resampler_skip_zeros,
