tizen 2.0 init
[framework/multimedia/gst-plugins-base0.10.git] / gst-libs / gst / audio / gstbaseaudiosrc.c
index 7c7ec93..a6d142b 100644 (file)
@@ -534,14 +534,17 @@ gst_base_audio_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
   /* fields for all formats */
   gst_structure_fixate_field_nearest_int (s, "rate", 44100);
   gst_structure_fixate_field_nearest_int (s, "channels", 2);
-  gst_structure_fixate_field_nearest_int (s, "width", 16);
-
-  /* fields for int */
-  if (gst_structure_has_field (s, "depth")) {
-    gst_structure_get_int (s, "width", &width);
-    /* round width to nearest multiple of 8 for the depth */
-    depth = GST_ROUND_UP_8 (width);
-    gst_structure_fixate_field_nearest_int (s, "depth", depth);
+
+  /* fields for int and/or float, but maybe not others like alaw/mulaw */
+  if (gst_structure_has_field (s, "width")) {
+    gst_structure_fixate_field_nearest_int (s, "width", 16);
+
+    if (gst_structure_has_field (s, "depth")) {
+      gst_structure_get_int (s, "width", &width);
+      /* round width to nearest multiple of 8 for the depth */
+      depth = GST_ROUND_UP_8 (width);
+      gst_structure_fixate_field_nearest_int (s, "depth", depth);
+    }
   }
   if (gst_structure_has_field (s, "signed"))
     gst_structure_fixate_field_boolean (s, "signed", TRUE);
@@ -561,8 +564,7 @@ gst_base_audio_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
   spec->latency_time = src->latency_time;
 
   GST_OBJECT_LOCK (src);
-  if (!gst_ring_buffer_parse_caps (spec, caps))
-  {
+  if (!gst_ring_buffer_parse_caps (spec, caps)) {
     GST_OBJECT_UNLOCK (src);
     goto parse_error;
   }
@@ -893,7 +895,7 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
         running_time_sample =
             gst_util_uint64_scale_int (running_time, spec->rate, GST_SECOND);
 
-        /* the segmentnr corrensponding to running_time, round down */
+        /* the segmentnr corresponding to running_time, round down */
         running_time_segment = running_time_sample / sps;
 
         /* the segment currently read from the ringbuffer */
@@ -919,7 +921,7 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
          *
          * 1. We are more than the length of the ringbuffer behind.
          *    The length of the ringbuffer then gets to dictate
-         *    the threshold for what is concidered "too late"
+         *    the threshold for what is considered "too late"
          *
          * 2. If this is our first buffer.
          *    We know that we should catch up to running_time
@@ -1150,7 +1152,7 @@ gst_base_audio_src_change_state (GstElement * element,
   /* ERRORS */
 open_failed:
   {
-    /* subclass must post a meaningfull error message */
+    /* subclass must post a meaningful error message */
     GST_DEBUG_OBJECT (src, "open failed");
     return GST_STATE_CHANGE_FAILURE;
   }