mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
gst-libs/gst/audio/gstbaseaudiosink.c: Our EOS time contains the base_time, _wait_eos() expects a running_time so we ...
Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_drain): Our EOS time contains the base_time, _wait_eos() expects a running_time so we have to subtract the base_time again before calling the function. This fixes an EOS regression where the base_time was added twice and EOS took longer and longer in certain situations. Fixes #498767.
This commit is contained in:
parent
157a65b15e
commit
ac1cc82165
2 changed files with 24 additions and 0 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2007-11-21 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
|
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
||||||
|
(gst_base_audio_sink_drain):
|
||||||
|
Our EOS time contains the base_time, _wait_eos() expects a running_time
|
||||||
|
so we have to subtract the base_time again before calling the function.
|
||||||
|
This fixes an EOS regression where the base_time was added twice and EOS
|
||||||
|
took longer and longer in certain situations.
|
||||||
|
Fixes #498767.
|
||||||
|
|
||||||
2007-11-21 Wim Taymans <wim.taymans@gmail.com>
|
2007-11-21 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
* docs/libs/gst-plugins-base-libs-sections.txt:
|
* docs/libs/gst-plugins-base-libs-sections.txt:
|
||||||
|
|
|
@ -639,6 +639,8 @@ gst_base_audio_sink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_base_audio_sink_drain (GstBaseAudioSink * sink)
|
gst_base_audio_sink_drain (GstBaseAudioSink * sink)
|
||||||
{
|
{
|
||||||
|
GstClockTime base_time;
|
||||||
|
|
||||||
if (!sink->ringbuffer)
|
if (!sink->ringbuffer)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (!sink->ringbuffer->spec.rate)
|
if (!sink->ringbuffer->spec.rate)
|
||||||
|
@ -662,6 +664,18 @@ gst_base_audio_sink_drain (GstBaseAudioSink * sink)
|
||||||
"last sample %" G_GUINT64_FORMAT ", time %" GST_TIME_FORMAT,
|
"last sample %" G_GUINT64_FORMAT ", time %" GST_TIME_FORMAT,
|
||||||
sink->next_sample, GST_TIME_ARGS (time));
|
sink->next_sample, GST_TIME_ARGS (time));
|
||||||
|
|
||||||
|
/* our time already includes the base_time, _wait_eos() wants a running_time
|
||||||
|
* so we have to subtract the base_time again here. FIXME, store an
|
||||||
|
* unadjusted EOS time so that we don't have to do this. */
|
||||||
|
GST_OBJECT_LOCK (sink);
|
||||||
|
base_time = GST_ELEMENT_CAST (sink)->base_time;
|
||||||
|
GST_OBJECT_UNLOCK (sink);
|
||||||
|
|
||||||
|
if (time > base_time)
|
||||||
|
time -= base_time;
|
||||||
|
else
|
||||||
|
time = 0;
|
||||||
|
|
||||||
/* wait for the EOS time to be reached, this is the time when the last
|
/* wait for the EOS time to be reached, this is the time when the last
|
||||||
* sample is played. */
|
* sample is played. */
|
||||||
gst_base_sink_wait_eos (GST_BASE_SINK (sink), time, NULL);
|
gst_base_sink_wait_eos (GST_BASE_SINK (sink), time, NULL);
|
||||||
|
|
Loading…
Reference in a new issue