comparison Plugins/Input/wma/libffwma/os_support.c @ 210:12004b385a96 trunk

[svn] Sync with xmms-wma instead of bmp-wma & GThreadify. Does not explode, but does not play either.
author chainsaw
date Sat, 19 Nov 2005 14:42:28 -0800
parents b8d4c1faa6d7
children 0bea7509d6ba
comparison
equal deleted inserted replaced
209:bd8457b077cf 210:12004b385a96
15 * You should have received a copy of the GNU Lesser General Public 15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software 16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19 #include "avformat.h" 19 #include "avformat.h"
20 20 #ifdef CONFIG_WIN32
21 #include <sys/types.h>
22 #include <sys/timeb.h>
23 #elif defined(CONFIG_OS2)
24 #include <string.h>
25 #include <sys/time.h>
26 #else
21 #include <unistd.h> 27 #include <unistd.h>
22 #include <fcntl.h> 28 #include <fcntl.h>
23 #include <sys/time.h> 29 #include <sys/time.h>
30 #endif
24 #include <time.h> 31 #include <time.h>
25 32
26 int64_t av_gettime(void) 33 int64_t av_gettime(void)
27 { 34 {
35 #ifdef CONFIG_WIN32
36 struct _timeb tb;
37 _ftime(&tb);
38 return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000);
39 #else
28 struct timeval tv; 40 struct timeval tv;
29 gettimeofday(&tv,NULL); 41 gettimeofday(&tv,NULL);
30 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; 42 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
43 #endif
31 } 44 }
32 45
33 #if !defined(HAVE_LOCALTIME_R) 46 #if !defined(HAVE_LOCALTIME_R)
34 struct tm *localtime_r(const time_t *t, struct tm *tp) 47 struct tm *localtime_r(const time_t *t, struct tm *tp)
35 { 48 {