summaryrefslogtreecommitdiffstats
path: root/ext/soundtouch
diff options
context:
space:
mode:
authorMichael Smith <msmith@xiph.org>2007-07-18 20:56:22 +0000
committerMichael Smith <msmith@xiph.org>2007-07-18 20:56:22 +0000
commita6058388c17adeace60b9e8b1daa2087f788e717 (patch)
treeac804948887a5ef5fc40c0c5ac84632603117ed6 /ext/soundtouch
parent9e023ea15614449f3795ff5c63b40bf0468cf01b (diff)
downloadgst-plugins-bad-a6058388c17adeace60b9e8b1daa2087f788e717.tar.gz
gst-plugins-bad-a6058388c17adeace60b9e8b1daa2087f788e717.tar.bz2
gst-plugins-bad-a6058388c17adeace60b9e8b1daa2087f788e717.zip
ext/soundtouch/gstpitch.cc: If we receive a new segment event, don't try to push buffers out in response (without fir...
Original commit message from CVS: * ext/soundtouch/gstpitch.cc: If we receive a new segment event, don't try to push buffers out in response (without first sending it on!). Instead, flush internal buffers on receiving flush events. Fixes playback after seeking.
Diffstat (limited to 'ext/soundtouch')
-rw-r--r--ext/soundtouch/gstpitch.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/soundtouch/gstpitch.cc b/ext/soundtouch/gstpitch.cc
index 8b09c2c4..da90c513 100644
--- a/ext/soundtouch/gstpitch.cc
+++ b/ext/soundtouch/gstpitch.cc
@@ -365,7 +365,7 @@ gst_pitch_prepare_buffer (GstPitch * pitch)
* samples are sent out here as strictly necessary, because soundtouch could
* append zero samples, which could disturb looping. */
static GstFlowReturn
-gst_pitch_flush_buffer (GstPitch * pitch)
+gst_pitch_flush_buffer (GstPitch * pitch, gboolean send)
{
GstBuffer *buffer;
@@ -375,6 +375,9 @@ gst_pitch_flush_buffer (GstPitch * pitch)
return GST_FLOW_OK;
pitch->priv->st->flush ();
+ if (!send)
+ return GST_FLOW_OK;
+
buffer = gst_pitch_prepare_buffer (pitch);
if (!buffer)
@@ -617,9 +620,11 @@ gst_pitch_sink_event (GstPad * pad, GstEvent * event)
GST_LOG_OBJECT (pad, "received %s event", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_NEWSEGMENT:
+ case GST_EVENT_FLUSH_STOP:
+ gst_pitch_flush_buffer (pitch, FALSE);
+ break;
case GST_EVENT_EOS:
- gst_pitch_flush_buffer (pitch);
+ gst_pitch_flush_buffer (pitch, TRUE);
break;
default:
break;