Commit 510a5bef authored by Wim Taymans's avatar Wim Taymans
Browse files

gst-libs/gst/audio/gstbaseaudiosrc.c: When not slaved to another clock also...

gst-libs/gst/audio/gstbaseaudiosrc.c: When not slaved to another clock also subtract the base_time from our internal ...

Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_create):
When not slaved to another clock also subtract the base_time from our
internal clock time to get the running time.
parent 23ca2ae3
2008-08-13 Wim Taymans <wim.taymans@collabora.co.uk>
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_create):
When not slaved to another clock also subtract the base_time from our
internal clock time to get the running time.
2008-08-12 David Schleef <ds@schleef.org>
 
* ext/theora/theoraenc.c: Remove the 2000 kbit limit to bitrate,
......@@ -816,8 +816,11 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
spec->rate) - timestamp;
GST_OBJECT_LOCK (src);
clock = GST_ELEMENT_CLOCK (src);
if (clock != NULL && clock != src->clock) {
if (!(clock = GST_ELEMENT_CLOCK (src)))
goto no_sync;
if (clock != src->clock) {
/* we are slaved, check how to handle this */
switch (src->priv->slave_method) {
case GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE:
/* not implemented, use retimestamp algorithm. This algorithm should
......@@ -852,7 +855,19 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
case GST_BASE_AUDIO_SRC_SLAVE_NONE:
break;
}
} else {
GstClockTime base_time;
/* we are not slaved, subtract base_time */
base_time = GST_ELEMENT_CAST (src)->base_time;
if (timestamp > base_time)
timestamp -= base_time;
else
timestamp = 0;
}
no_sync:
GST_OBJECT_UNLOCK (src);
GST_BUFFER_TIMESTAMP (buf) = timestamp;
......
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