sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include <3gplibrary/mp4config.h> sl@0: #include "mp4currenttime.h" sl@0: #include sl@0: sl@0: sl@0: /* sl@0: * Function: sl@0: * sl@0: * mp4_i32 getCurrentTime(mp4_u32 *currentTime) sl@0: * sl@0: * Description: sl@0: * sl@0: * Calculate time in seconds since Jan 1st, 1970. sl@0: * sl@0: * Parameters: sl@0: * sl@0: * currentTime Time is returned here. sl@0: * sl@0: * Return value: sl@0: * sl@0: * 0 Success sl@0: * -1 Error sl@0: * sl@0: */ sl@0: mp4_i32 getCurrentTime(mp4_u32 *currentTime) sl@0: { sl@0: time_t ltime; sl@0: sl@0: /* Get time in seconds since Jan 1st, 1970 */ sl@0: if (time(<ime) == -1) sl@0: return -1; sl@0: sl@0: /* Convert time to start from Jan 1st, 1904 */ sl@0: *currentTime = (mp4_u32)ltime + ((mp4_u32)66 * 365 + 17) * 24 * 3600; sl@0: sl@0: return 0; sl@0: } sl@0: sl@0: // End of File