*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
static void
gst_1394_clock_init (Gst1394Clock * clock)
{
- clock->last_time = 0;
GST_OBJECT_FLAG_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER);
}
gst_1394_clock_new (const gchar * name)
{
Gst1394Clock *_1394clock =
- GST_1394_CLOCK (g_object_new (GST_TYPE_1394_CLOCK, "name", name, NULL));
+ GST_1394_CLOCK (g_object_new (GST_TYPE_1394_CLOCK, "name", name,
+ "clock-type", GST_CLOCK_TYPE_OTHER, NULL));
+
+ /* Clear floating flag */
+ gst_object_ref_sink (_1394clock);
return _1394clock;
}
_1394clock = GST_1394_CLOCK_CAST (clock);
if (_1394clock->handle != NULL) {
+ GST_OBJECT_LOCK (clock);
raw1394_read_cycle_timer (_1394clock->handle, &cycle_timer, &local_time);
if (cycle_timer < _1394clock->cycle_timer_lo) {
result = (((((guint64) _1394clock->cycle_timer_hi) << 32) |
cycle_timer) >> 25) * GST_SECOND;
/* add the microseconds from the cycleCount counter */
- result += (((cycle_timer >> 13) & 0x1fff) * 125) * GST_USECOND;
+ result += (((cycle_timer >> 12) & 0x1fff) * 125) * GST_USECOND;
GST_LOG_OBJECT (clock, "result %" GST_TIME_FORMAT, GST_TIME_ARGS (result));
+ GST_OBJECT_UNLOCK (clock);
} else {
result = GST_CLOCK_TIME_NONE;
}