From c3dda05a8b63727a580f84e2e3845e16a8f5b5ed Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 8 Oct 2007 18:02:53 +0000 Subject: [PATCH] gst-libs/gst/audio/gstbaseaudiosrc.c: Also handle the case where there is no clock set on the audio source, like in t... Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosrc.c: (gst_base_audio_src_create): Also handle the case where there is no clock set on the audio source, like in the unit tests. --- ChangeLog | 7 +++++++ gst-libs/gst/audio/gstbaseaudiosrc.c | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a4be4df98..0f2707241f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-08 Wim Taymans + + * gst-libs/gst/audio/gstbaseaudiosrc.c: + (gst_base_audio_src_create): + Also handle the case where there is no clock set on the audio source, + like in the unit tests. + 2007-10-08 Jan Schmidt * gst-libs/gst/rtp/gstrtppayloads.c: diff --git a/gst-libs/gst/audio/gstbaseaudiosrc.c b/gst-libs/gst/audio/gstbaseaudiosrc.c index f4db54d7d0..7f1ae61329 100644 --- a/gst-libs/gst/audio/gstbaseaudiosrc.c +++ b/gst-libs/gst/audio/gstbaseaudiosrc.c @@ -620,18 +620,18 @@ gst_base_audio_src_create (GstBaseSrc * bsrc, guint64 offset, guint length, GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT); } - /* FIXME, we timestamp against our own clock, also handle the case - * where we are slaved to another clock. We currently refuse to accept - * any other clock than the one we provide, so this code is fine for - * now. */ GST_OBJECT_LOCK (src); clock = GST_ELEMENT_CLOCK (src); - if (clock == src->clock) { + if (clock == NULL || clock == src->clock) { + /* timestamp against our own clock. We do this also when no external clock + * was provided to us. */ timestamp = gst_util_uint64_scale_int (sample, GST_SECOND, spec->rate); } else { GstClockTime base_time, latency; - /* take running time of the clock */ + /* We are slaved to another clock, take running time of the clock and just + * timestamp against it. Somebody else in the pipeline should figure out the + * clock drift, for now. */ timestamp = gst_clock_get_time (clock); base_time = GST_ELEMENT_CAST (src)->base_time;