gst/volume/gstvolume.c: Increase "volume" property to 10.0. Fixes #340369.
authorWim Taymans <wim.taymans@gmail.com>
Wed, 3 May 2006 08:58:13 +0000 (08:58 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 3 May 2006 08:58:13 +0000 (08:58 +0000)
Original commit message from CVS:
* gst/volume/gstvolume.c: (volume_funcfind), (volume_set_caps),
(volume_transform_ip):
Increase "volume" property to 10.0. Fixes #340369.
Set the process function to NULL when capsnego fails so that
we properly error out.

ChangeLog
gst/volume/gstvolume.c

index 29e60ed..d5db267 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-05-03  Wim Taymans  <wim@fluendo.com>
+
+       * gst/volume/gstvolume.c: (volume_funcfind), (volume_set_caps),
+       (volume_transform_ip):
+       Increase "volume" property to 10.0. Fixes #340369.
+       Set the process function to NULL when capsnego fails so that
+       we properly error out.
+
 2006-05-02  Stefan Kost  <ensonic@users.sf.net>
 
        * gst/playback/gstplaybin.c: (add_sink):
index 311e2de..ca5b4ae 100644 (file)
@@ -59,7 +59,7 @@
  */
 #define VOLUME_UNITY_INT        8192    /* internal int for unity */
 #define VOLUME_UNITY_BIT_SHIFT  13      /* number of bits to shift for unity */
-#define VOLUME_MAX_DOUBLE       4.0
+#define VOLUME_MAX_DOUBLE       10.0
 #define VOLUME_MAX_INT16        32767
 #define VOLUME_MIN_INT16        -32768
 
@@ -334,6 +334,8 @@ volume_funcfind (GstVolume * this, const GstStructure * structure)
     this->process = volume_process_int16;
   else if (strcmp (mimetype, "audio/x-raw-float") == 0)
     this->process = volume_process_float;
+  else
+    this->process = NULL;
 }
 
 static void
@@ -391,14 +393,21 @@ volume_set_caps (GstBaseTransform * base, GstCaps * incaps, GstCaps * outcaps)
 
   GST_DEBUG_OBJECT (this,
       "set_caps: in %" GST_PTR_FORMAT " out %" GST_PTR_FORMAT, incaps, outcaps);
+
   volume_funcfind (this, gst_caps_get_structure (incaps, 0));
 
-  if (!this->process) {
+  if (!this->process)
+    goto invalid_format;
+
+  return TRUE;
+
+  /* ERRORS */
+invalid_format:
+  {
     GST_ELEMENT_ERROR (this, CORE, NEGOTIATION,
         ("Invalid incoming caps: %" GST_PTR_FORMAT, incaps), (NULL));
     return FALSE;
   }
-  return TRUE;
 }
 
 /* call the plugged-in process function for this instance
@@ -409,11 +418,14 @@ static GstFlowReturn
 volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
 {
   GstVolume *this = GST_VOLUME (base);
+  GstClockTime timestamp;
+
+  timestamp = GST_BUFFER_TIMESTAMP (outbuf);
 
-  if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (outbuf)))
-    gst_object_sync_values (G_OBJECT (this), GST_BUFFER_TIMESTAMP (outbuf));
+  if (GST_CLOCK_TIME_IS_VALID (timestamp))
+    gst_object_sync_values (G_OBJECT (this), timestamp);
 
-  this->process (this, GST_BUFFER_TIMESTAMP (outbuf),
+  this->process (this, timestamp,
       GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf));
 
   return GST_FLOW_OK;