Index: gstalsa.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins/ext/alsa/Attic/gstalsa.c,v
retrieving revision 1.136.2.7
diff -u -p -r1.136.2.7 gstalsa.c
--- gstalsa.c	19 Jun 2005 16:10:49 -0000	1.136.2.7
+++ gstalsa.c	30 Oct 2005 14:08:15 -0000
@@ -263,7 +263,7 @@ gst_alsa_set_property (GObject * object,
       break;
     case ARG_PERIODSIZE:
       g_return_if_fail (!GST_FLAG_IS_SET (this, GST_ALSA_RUNNING));
-      this->period_size = g_value_get_int (value);
+      this->desired_period_size = g_value_get_int (value);
       break;
     case ARG_BUFFERSIZE:
       g_return_if_fail (!GST_FLAG_IS_SET (this, GST_ALSA_RUNNING));
@@ -312,7 +312,7 @@ gst_alsa_get_property (GObject * object,
       g_value_set_int (value, this->period_count);
       break;
     case ARG_PERIODSIZE:
-      g_value_set_int (value, this->period_size);
+      g_value_set_int (value, this->desired_period_size);
       break;
     case ARG_BUFFERSIZE:
       g_value_set_int (value, this->period_size * this->period_count);
@@ -1685,7 +1685,6 @@ static gboolean
 gst_alsa_probe_hw_params (GstAlsa * this, GstAlsaFormat * format)
 {
   snd_pcm_hw_params_t *hw_params;
-  snd_pcm_uframes_t period_size;
   unsigned int period_count;
   unsigned int rate;
 
@@ -1735,9 +1734,11 @@ gst_alsa_probe_hw_params (GstAlsa * this
     SIMPLE_ERROR_CHECK (snd_pcm_hw_params_set_periods_near (this->handle,
             hw_params, &period_count, 0));
   }
-  period_size = this->period_size;
+  this->period_size = this->desired_period_size;
   SIMPLE_ERROR_CHECK (snd_pcm_hw_params_set_period_size_near (this->handle,
-          hw_params, &period_size, 0));
+          hw_params, &this->period_size, 0));
+  GST_DEBUG ("Desired period size: %d, actual period size: %d",
+      this->desired_period_size, this->period_size);
 
   return TRUE;
 }
@@ -1753,7 +1754,6 @@ gst_alsa_set_hw_params (GstAlsa * this)
   snd_pcm_hw_params_t *hw_params;
   unsigned int rate;
   int ret;
-  snd_pcm_uframes_t period_size;
 
   g_return_val_if_fail (this != NULL, FALSE);
   g_return_val_if_fail (this->handle != NULL, FALSE);
@@ -1816,12 +1816,12 @@ gst_alsa_set_hw_params (GstAlsa * this)
       }
     }
 
-    period_size = this->period_size;
+    this->period_size = this->desired_period_size;
     ERROR_CHECK (snd_pcm_hw_params_set_period_size_near (this->handle,
-            hw_params, &period_size, 0),
-        "error setting period size to %u frames: %s", (guint) period_size);
-    if (this->period_size == 0)
-      this->period_size = period_size;
+            hw_params, &this->period_size, 0),
+        "error setting period size to %u frames: %s", (guint) this->period_size);
+    GST_DEBUG ("Desired period size: %d, actual period size: %d",
+        this->desired_period_size, this->period_size);
   } else {
     GST_INFO_OBJECT (this, "Preparing format: (none)");
   }
Index: gstalsa.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins/ext/alsa/Attic/gstalsa.h,v
retrieving revision 1.46.2.2
diff -u -p -r1.46.2.2 gstalsa.h
--- gstalsa.h	19 Jun 2005 15:52:08 -0000	1.46.2.2
+++ gstalsa.h	30 Oct 2005 14:08:15 -0000
@@ -164,6 +164,7 @@ struct _GstAlsa {
   GstCaps *			cached_caps;	/* we cache caps to speed up get_caps */
 
   /* latency / performance parameters */
+  snd_pcm_uframes_t		desired_period_size;	/* as set by user */
   snd_pcm_uframes_t		period_size;
   unsigned int			desired_period_count;	/* as set by user */
   unsigned int			period_count;
