summaryrefslogtreecommitdiffstats
path: root/ext/sndfile/gstsf.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2004-02-20 14:17:57 +0000
committerAndy Wingo <wingo@pobox.com>2004-02-20 14:17:57 +0000
commit22b1839fe2746f5f6a2c759ed84d697d356e13ed (patch)
tree4a9a9f6aa58b9e08216d22697aab589be4603292 /ext/sndfile/gstsf.c
parentea5845cb2bfdb57a06cc2ad5b2561889b5fcc049 (diff)
downloadgst-plugins-bad-22b1839fe2746f5f6a2c759ed84d697d356e13ed.tar.gz
gst-plugins-bad-22b1839fe2746f5f6a2c759ed84d697d356e13ed.tar.bz2
gst-plugins-bad-22b1839fe2746f5f6a2c759ed84d697d356e13ed.zip
gst/intfloat/, gst/oneton: Removed, replaced by audioconvert and interleave respectively.
Original commit message from CVS: 2004-02-20 Andy Wingo <wingo@pobox.com> * gst/intfloat/, gst/oneton: Removed, replaced by audioconvert and interleave respectively. * gst/interleave/deinterleave.c: New plugin: deinterleave (replaces on oneton). * gst/interleave/interleave.c: New plugin: interleave. * gst/interleave/plugin.h: Support file. * gst/interleave/plugin.c: Support file. * configure.ac: Remove intfloat and oneton, add interleave. * ext/sndfile/gstsf.c: Handle events better. * gst/audioconvert/gstaudioconvert.c: Change to support int2float and float2int operation. int2float has scheduling problems as noted in in2float_chain.
Diffstat (limited to 'ext/sndfile/gstsf.c')
-rw-r--r--ext/sndfile/gstsf.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/sndfile/gstsf.c b/ext/sndfile/gstsf.c
index 78b8480b..cc7e3d14 100644
--- a/ext/sndfile/gstsf.c
+++ b/ext/sndfile/gstsf.c
@@ -535,7 +535,7 @@ gst_sf_link (GstPad *pad, const GstCaps *caps)
gst_structure_get_int (structure, "rate", &this->rate);
gst_structure_get_int (structure, "buffer-frames", &this->buffer_frames);
- INFO_OBJ (this, "linked pad %s:%s with fixed caps, frames=%d, rate=%d",
+ INFO_OBJ (this, "linked pad %s:%s with fixed caps, rate=%d, frames=%d",
GST_DEBUG_PAD_NAME (pad), this->rate, this->buffer_frames);
if (this->numchannels) {
@@ -756,6 +756,7 @@ gst_sf_loop (GstElement *element)
for (i=0,l=this->channels; l; l=l->next,i++) {
channel = GST_SF_CHANNEL (l);
+ pull_again:
in = GST_BUFFER (gst_pad_pull (channel->pad));
if (buffer_frames == 0) {
@@ -776,13 +777,24 @@ gst_sf_loop (GstElement *element)
return; /* we've already set gst_element_error */
if (GST_IS_EVENT (in)) {
- num_to_write = 0;
- } else {
+ switch (GST_EVENT_TYPE (in)) {
+ case GST_EVENT_EOS:
+ case GST_EVENT_INTERRUPT:
+ num_to_write = 0;
+ break;
+ default:
+ goto pull_again;
+ break;
+ }
+ }
+
+ if (num_to_write) {
data = (gfloat*)GST_BUFFER_DATA (in);
num_to_write = MIN (num_to_write, GST_BUFFER_SIZE (in) / sizeof (gfloat));
for (j=0; j<num_to_write; j++)
buf[j * nchannels + i % nchannels] = data[j];
}
+
gst_data_unref ((GstData*)in);
}