From: <wt...@ke...> - 2008-08-13 09:17:44
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: wtay Date: Wed Aug 13 2008 09:17:52 UTC Log message: * 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. Modified files: . : ChangeLog gst-libs/gst/audio: gstbaseaudiosrc.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.4091&r2=1.4092 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosrc.c.diff?r1=1.46&r2=1.47 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.4091 retrieving revision 1.4092 diff -u -d -r1.4091 -r1.4092 --- ChangeLog 13 Aug 2008 00:59:05 -0000 1.4091 +++ ChangeLog 13 Aug 2008 09:17:37 -0000 1.4092 @@ -1,3 +1,10 @@ +2008-08-13 Wim Taymans <wim...@co...> + + * 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...@sc...> * ext/theora/theoraenc.c: Remove the 2000 kbit limit to bitrate, Index: gstbaseaudiosrc.c RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosrc.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- gstbaseaudiosrc.c 7 Aug 2008 15:58:51 -0000 1.46 +++ gstbaseaudiosrc.c 13 Aug 2008 09:17:38 -0000 1.47 @@ -816,8 +816,11 @@ 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 @@ 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; |