CVS Root: /cvs/gstreamer
Module: gst-plugins-base
Changes by: wtay
Date: Tue Nov 25 2008 10:33:04 UTC
Log message:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_drain), (gst_base_audio_sink_event),
(gst_base_audio_sink_sync_latency), (gst_base_audio_sink_render),
(gst_base_audio_sink_change_state):
Really fix audiosink drain handling by keeping track of the running_time
of the last sample.
Modified files:
. : ChangeLog
gst-libs/gst/audio: gstbaseaudiosink.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.4213&r2=1.4214
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosink.c.diff?r1=1.110&r2=1.111
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v
retrieving revision 1.4213
retrieving revision 1.4214
diff -u -d -r1.4213 -r1.4214
--- ChangeLog 24 Nov 2008 20:25:23 -0000 1.4213
+++ ChangeLog 25 Nov 2008 10:32:47 -0000 1.4214
@@ -1,3 +1,12 @@
+2008-11-25 Wim Taymans <[email protected]>
+
+ * gst-libs/gst/audio/gstbaseaudiosink.c:
+ (gst_base_audio_sink_drain), (gst_base_audio_sink_event),
+ (gst_base_audio_sink_sync_latency), (gst_base_audio_sink_render),
+ (gst_base_audio_sink_change_state):
+ Really fix audiosink drain handling by keeping track of the running_time
+ of the last sample.
2008-11-24 Michael Smith <[email protected]>
* gst/playback/gstplaybin2.c:
Index: gstbaseaudiosink.c
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosink.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- gstbaseaudiosink.c 24 Nov 2008 20:11:52 -0000 1.110
+++ gstbaseaudiosink.c 25 Nov 2008 10:32:49 -0000 1.111
@@ -54,6 +54,8 @@
gint64 last_align;
gboolean sync_latency;
+ GstClockTime eos_time;
};
/* BaseAudioSink signals and args */
@@ -720,23 +722,15 @@
if (gst_ring_buffer_is_acquired (sink->ringbuffer))
gst_ring_buffer_start (sink->ringbuffer);
- if (sink->next_sample != -1) {
- GstClockTime time;
-
- /* convert next expected sample to time */
- time =
- gst_util_uint64_scale_int (sink->next_sample, GST_SECOND,
- sink->ringbuffer->spec.rate);
+ if (sink->priv->eos_time != -1) {
GST_DEBUG_OBJECT (sink,
- "last sample %" G_GUINT64_FORMAT ", time %" GST_TIME_FORMAT,
- sink->next_sample, GST_TIME_ARGS (time));
+ "last sample time %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (sink->priv->eos_time));
/* wait for the EOS time to be reached, this is the time when the last
* sample is played. */
- gst_base_sink_wait_eos (GST_BASE_SINK (sink), time, NULL);
+ gst_base_sink_wait_eos (GST_BASE_SINK (sink), sink->priv->eos_time, NULL);
- sink->next_sample = -1;
GST_DEBUG_OBJECT (sink, "drained audio");
}
return TRUE;
@@ -756,6 +750,7 @@
/* always resync on sample after a flush */
sink->priv->avg_skew = -1;
sink->next_sample = -1;
+ sink->priv->eos_time = -1;
if (sink->ringbuffer)
gst_ring_buffer_set_flushing (sink->ringbuffer, FALSE);
break;
@@ -1169,6 +1164,7 @@
sink->priv->avg_skew = -1;
sink->next_sample = -1;
+ sink->priv->eos_time = -1;
return GST_FLOW_OK;
@@ -1354,12 +1350,13 @@
"running: start %" GST_TIME_FORMAT " - stop %" GST_TIME_FORMAT,
GST_TIME_ARGS (render_start), GST_TIME_ARGS (render_stop));
- GST_DEBUG_OBJECT (sink, "adding base_time %" GST_TIME_FORMAT,
- GST_TIME_ARGS (base_time));
- /* add base time to sync against the clock */
- render_start += base_time;
- render_stop += base_time;
+ /* store the time of the last sample, we'll use this to perform sync on the
+ * last sample when draining the buffer */
+ if (bsink->segment.rate >= 0.0) {
+ sink->priv->eos_time = render_stop;
+ } else {
+ sink->priv->eos_time = render_start;
+ }
/* compensate for ts-offset and delay we know this will not underflow because we
* clipped above. */
@@ -1369,6 +1366,13 @@
render_start += sync_offset;
render_stop += sync_offset;
+ GST_DEBUG_OBJECT (sink, "adding base_time %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (base_time));
+ /* add base time to sync against the clock */
+ render_start += base_time;
+ render_stop += base_time;
GST_DEBUG_OBJECT (sink,
"after compensation: start %" GST_TIME_FORMAT " - stop %" GST_TIME_FORMAT,
@@ -1737,6 +1741,7 @@
case GST_STATE_CHANGE_READY_TO_PAUSED:
sink->priv->last_align = -1;
gst_ring_buffer_set_flushing (sink->ringbuffer, FALSE);
gst_ring_buffer_may_start (sink->ringbuffer, FALSE);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.