gst-libs/gst/audio/TODO: Updated.

Original commit message from CVS:
* gst-libs/gst/audio/TODO:
Updated.

* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_drain), (gst_base_audio_sink_event):
On EOS, wait till the last sample is played before posting EOS.
This commit is contained in:
Wim Taymans 2006-02-02 12:14:35 +00:00
parent 10cf7276d1
commit 416c011f11
3 changed files with 42 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2006-02-02 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/audio/TODO:
Updated.
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_drain), (gst_base_audio_sink_event):
On EOS, wait till the last sample is played before posting EOS.
2006-02-01 Philippe Kalaf <burger at speedy dot org>
* gst-libs/gst/rtp/gstbasertpdepayload.c:

View file

@ -7,8 +7,6 @@ TODO
is parsed correctly.
- implement seek/query/convert
- implement getrange scheduling
- on EOS, only post EOS when the complete ringbuffer has been played.
- more accurate clipping of samples outside of the segment
- simple resampling
- more accurate master/slave calibration handling
- faster audio cutoff when going to PAUSED

View file

@ -319,6 +319,38 @@ gst_base_audio_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
*end = GST_CLOCK_TIME_NONE;
}
static gboolean
gst_base_audio_sink_drain (GstBaseAudioSink * sink)
{
if (!sink->ringbuffer)
return TRUE;
if (!sink->ringbuffer->spec.rate)
return TRUE;
if (sink->next_sample != -1) {
GstClockTime time;
GstClock *clock;
time =
gst_util_uint64_scale_int (sink->next_sample, GST_SECOND,
sink->ringbuffer->spec.rate);
GST_OBJECT_LOCK (sink);
if ((clock = GST_ELEMENT_CLOCK (sink)) != NULL) {
GstClockID id = gst_clock_new_single_shot_id (clock, time);
GST_OBJECT_UNLOCK (sink);
GST_DEBUG_OBJECT (sink, "waiting for last sample to play");
gst_clock_id_wait (id, NULL);
sink->next_sample = -1;
} else {
GST_OBJECT_UNLOCK (sink);
}
}
return TRUE;
}
static gboolean
gst_base_audio_sink_event (GstBaseSink * bsink, GstEvent * event)
{
@ -337,6 +369,7 @@ gst_base_audio_sink_event (GstBaseSink * bsink, GstEvent * event)
/* need to start playback when we reach EOS */
gst_ring_buffer_start (sink->ringbuffer);
/* now wait till we played everything */
gst_base_audio_sink_drain (sink);
break;
default:
break;