From 79453e9df43cd22fd3b516a2a9a71b064306dff1 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 4 Jun 2002 22:22:25 +0000 Subject: fix gstarts. the sound is krappy, but it does make sound -- remember to do osssink sync=false Original commit message from CVS: fix gstarts. the sound is krappy, but it does make sound -- remember to do osssink sync=false --- ext/arts/gst_artsio_impl.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'ext/arts/gst_artsio_impl.cc') diff --git a/ext/arts/gst_artsio_impl.cc b/ext/arts/gst_artsio_impl.cc index 1570555a..876e2b5b 100644 --- a/ext/arts/gst_artsio_impl.cc +++ b/ext/arts/gst_artsio_impl.cc @@ -17,6 +17,7 @@ class ArtsStereoSink_impl : virtual public ArtsStereoSink_skel, { GstPad *sinkpad; + GstPad *srcpad; unsigned long remainingsamples; GstBuffer *inbuf; unsigned char *dataptr; @@ -46,6 +47,17 @@ public: // start by pulling a buffer from GStreamer inbuf = gst_pad_pull (sinkpad); + while (GST_IS_EVENT (inbuf)) { + switch (GST_EVENT_TYPE (inbuf)) { + case GST_EVENT_EOS: + gst_element_set_eos (GST_PAD_PARENT (sinkpad)); + default: + break; + } + gst_pad_event_default (srcpad, (GstEvent*)inbuf); + inbuf = gst_pad_pull (sinkpad); + } + dataptr = GST_BUFFER_DATA(inbuf); remainingsamples = GST_BUFFER_SIZE(inbuf) / 4; //fprintf(stderr,"got a buffer with %d samples\n",remainingsamples); @@ -67,6 +79,10 @@ public: { sinkpad = pad; } + void setSrcPad(GstPad *pad) + { + srcpad = pad; + } }; @@ -114,6 +130,7 @@ public: ArtsStereoSink_impl *sink_impl = new ArtsStereoSink_impl(); ArtsStereoSrc_impl *source_impl = new ArtsStereoSrc_impl(); sink_impl->setPad(sinkpad); + sink_impl->setSrcPad(sourcepad); source_impl->setPad(sourcepad); sink = ArtsStereoSink::_from_base(sink_impl); source = ArtsStereoSrc::_from_base(source_impl); -- cgit v1.2.1