diff options
author | Sebastian Dröge <mail@slomosnail.de> | 2006-12-08 16:38:18 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2006-12-08 16:38:18 +0000 |
commit | 6a016876c8b44462da63f10c169521c0a66aa72d (patch) | |
tree | d38f73cff86adc8ce977abebe83a7fe7f06390dc /gst/audiofx | |
parent | a3b5d523d8edd62920bb4f75f67abdd574e24fb5 (diff) |
gst/audiofx/audiopanorama.*: Fix audiopanorame with float samples. Fixes #383726.
Original commit message from CVS:
Patch by: Sebastian Dröge <mail at slomosnail de >
* gst/audiofx/audiopanorama.c: (gst_audio_panorama_init),
(gst_audio_panorama_set_caps), (gst_audio_panorama_transform):
* gst/audiofx/audiopanorama.h:
Fix audiopanorame with float samples. Fixes #383726.
Diffstat (limited to 'gst/audiofx')
-rw-r--r-- | gst/audiofx/audiopanorama.c | 14 | ||||
-rw-r--r-- | gst/audiofx/audiopanorama.h | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gst/audiofx/audiopanorama.c b/gst/audiofx/audiopanorama.c index 6b9cd8c4..dec95502 100644 --- a/gst/audiofx/audiopanorama.c +++ b/gst/audiofx/audiopanorama.c @@ -168,6 +168,7 @@ gst_audio_panorama_init (GstAudioPanorama * filter, GstAudioPanoramaClass * klass) { filter->panorama = 0; + filter->width = 0; } static void @@ -253,7 +254,7 @@ gst_audio_panorama_set_caps (GstBaseTransform * base, GstCaps * incaps, GstAudioPanorama *filter = GST_AUDIO_PANORAMA (base); const GstStructure *structure; gboolean ret; - gint channels; + gint channels, width; const gchar *fmt; /*GST_INFO ("incaps are %" GST_PTR_FORMAT, incaps); */ @@ -263,6 +264,12 @@ gst_audio_panorama_set_caps (GstBaseTransform * base, GstCaps * incaps, if (!ret) goto no_channels; + ret = gst_structure_get_int (structure, "width", &width); + if (!ret) + goto no_width; + filter->width = width / 8; + + fmt = gst_structure_get_name (structure); GST_DEBUG ("try to process %s input with %d channels", fmt, channels); @@ -297,6 +304,9 @@ gst_audio_panorama_set_caps (GstBaseTransform * base, GstCaps * incaps, no_channels: GST_DEBUG ("no channels in caps"); return ret; +no_width: + GST_DEBUG ("no width in caps"); + return ret; } static void @@ -434,7 +444,7 @@ gst_audio_panorama_transform (GstBaseTransform * base, GstBuffer * inbuf, GstBuffer * outbuf) { GstAudioPanorama *filter = GST_AUDIO_PANORAMA (base); - guint num_samples = GST_BUFFER_SIZE (outbuf) / (2 * sizeof (gint16)); + guint num_samples = GST_BUFFER_SIZE (outbuf) / (2 * filter->width); if (!gst_buffer_is_writable (outbuf)) return GST_FLOW_OK; diff --git a/gst/audiofx/audiopanorama.h b/gst/audiofx/audiopanorama.h index 623e9a68..eaa9927b 100644 --- a/gst/audiofx/audiopanorama.h +++ b/gst/audiofx/audiopanorama.h @@ -45,6 +45,7 @@ struct _GstAudioPanorama { /* < private > */ GstAudioPanoramaProcessFunc process; + gint width; }; struct _GstAudioPanoramaClass { |