diff --git a/ChangeLog b/ChangeLog index 29e60ed115..d5db267917 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-05-03 Wim Taymans + + * 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 * gst/playback/gstplaybin.c: (add_sink): diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c index 311e2defa3..ca5b4aef72 100644 --- a/gst/volume/gstvolume.c +++ b/gst/volume/gstvolume.c @@ -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; - if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (outbuf))) - gst_object_sync_values (G_OBJECT (this), GST_BUFFER_TIMESTAMP (outbuf)); + timestamp = GST_BUFFER_TIMESTAMP (outbuf); - this->process (this, GST_BUFFER_TIMESTAMP (outbuf), + if (GST_CLOCK_TIME_IS_VALID (timestamp)) + gst_object_sync_values (G_OBJECT (this), timestamp); + + this->process (this, timestamp, GST_BUFFER_DATA (outbuf), GST_BUFFER_SIZE (outbuf)); return GST_FLOW_OK;