Commit 8a499651 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst-libs/gst/audio/gstbaseaudiosink.c: Quick hack to make audiosinks stop at...

gst-libs/gst/audio/gstbaseaudiosink.c: Quick hack to make audiosinks stop at EOS when operating in pull-mode; needs t...

Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_callback):
Quick hack to make audiosinks stop at EOS when operating in
pull-mode; needs to be fixed properly some day.
parent e59bb29a
2007-07-08 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_callback):
Quick hack to make audiosinks stop at EOS when operating in
pull-mode; needs to be fixed properly some day.
2007-07-06 Stefan Kost <ensonic@users.sf.net>
 
* docs/libs/gst-plugins-base-libs-sections.txt:
......@@ -1191,8 +1191,13 @@ gst_base_audio_sink_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
GST_LOG_OBJECT (basesink, "pulling %d bytes offset %" G_GUINT64_FORMAT
" to fill audio buffer", len, basesink->offset);
ret = gst_pad_pull_range (basesink->sinkpad, basesink->offset, len, &buf);
if (ret != GST_FLOW_OK)
goto error;
if (ret != GST_FLOW_OK) {
if (ret == GST_FLOW_UNEXPECTED)
goto eos;
else
goto error;
}
if (len != GST_BUFFER_SIZE (buf)) {
GST_INFO_OBJECT (basesink, "short read pulling from sink pad: %d<%d",
......@@ -1212,6 +1217,16 @@ error:
ret);
return;
}
eos:
{
/* FIXME: this is not quite correct; we'll be called endlessly until
* the sink gets shut down; maybe we should set a flag somewhere, or
* set segment.stop and segment.duration to the last sample or so */
GST_DEBUG_OBJECT (sink, "EOS");
gst_element_post_message (GST_ELEMENT_CAST (sink),
gst_message_new_eos (GST_OBJECT_CAST (sink)));
gst_base_audio_sink_drain (sink);
}
}
/* should be called with the LOCK */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment