[xiph-commits] r3114 - liboggplay/trunk/src/liboggplay
shans at svn.annodex.net
shans at svn.annodex.net
Wed Jun 27 23:26:14 PDT 2007
Author: shans
Date: 2007-06-27 23:26:14 -0700 (Wed, 27 Jun 2007)
New Revision: 3114
Added:
liboggplay/trunk/src/liboggplay/oggplay_tools.c
Modified:
liboggplay/trunk/src/liboggplay/Makefile.am
liboggplay/trunk/src/liboggplay/oggplay.c
Log:
Moved some oggplay functions into new oggplay_tools.c file
Modified: liboggplay/trunk/src/liboggplay/Makefile.am
===================================================================
--- liboggplay/trunk/src/liboggplay/Makefile.am 2007-06-28 06:20:14 UTC (rev 3113)
+++ liboggplay/trunk/src/liboggplay/Makefile.am 2007-06-28 06:26:14 UTC (rev 3114)
@@ -27,7 +27,8 @@
oggplay_callback_info.c \
oggplay_buffer.c \
oggplay_yuv2rgb.c \
- oggplay_seek.c
+ oggplay_seek.c \
+ oggplay_tools.c
liboggplay_la_CFLAGS = $(AM_CFLAGS) $(OGGZ_CFLAGS)
liboggplay_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@
Modified: liboggplay/trunk/src/liboggplay/oggplay.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay.c 2007-06-28 06:20:14 UTC (rev 3113)
+++ liboggplay/trunk/src/liboggplay/oggplay.c 2007-06-28 06:26:14 UTC (rev 3114)
@@ -43,12 +43,6 @@
#include <string.h>
#include <stdlib.h>
-#ifndef WIN32
-#include <sys/time.h>
-#endif
-
-#include <time.h>
-
#define OGGZ_READ_CHUNK_SIZE 8192
OggPlay *
@@ -572,25 +566,4 @@
return me->reader->duration(me->reader);
}
-ogg_int64_t
-oggplay_sys_time_in_ms(void) {
-#ifdef WIN32
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- return ((ogg_int64_t)ft.dwHighDateTime << 32 | ft.dwLowDateTime) / 10000;
-#else
- struct timeval tv;
- gettimeofday(&tv, NULL);
- return (ogg_int64_t)tv.tv_sec * 1000 + (ogg_int64_t)tv.tv_usec / 1000;
-#endif
-}
-void
-oggplay_millisleep(long ms) {
-#ifdef WIN32
- Sleep(ms);
-#else
- struct timespec ts = {0, (ogg_int64_t)ms * 1000000LL};
- nanosleep(&ts, NULL);
-#endif
-}
Added: liboggplay/trunk/src/liboggplay/oggplay_tools.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_tools.c (rev 0)
+++ liboggplay/trunk/src/liboggplay/oggplay_tools.c 2007-06-28 06:26:14 UTC (rev 3114)
@@ -0,0 +1,70 @@
+/*
+ Copyright (C) 2003 Commonwealth Scientific and Industrial Research
+ Organisation (CSIRO) Australia
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of CSIRO Australia nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+ * oggplay_tools.c
+ *
+ * Shane Stephens <shane.stephens at annodex.net>
+ * Michael Martin
+ */
+
+
+#include "oggplay_private.h"
+
+#ifndef WIN32
+#include <sys/time.h>
+#endif
+
+#include <time.h>
+
+ogg_int64_t
+oggplay_sys_time_in_ms(void) {
+#ifdef WIN32
+ FILETIME ft;
+ GetSystemTimeAsFileTime(&ft);
+ return ((ogg_int64_t)ft.dwHighDateTime << 32 | ft.dwLowDateTime) / 10000;
+#else
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return (ogg_int64_t)tv.tv_sec * 1000 + (ogg_int64_t)tv.tv_usec / 1000;
+#endif
+}
+
+void
+oggplay_millisleep(long ms) {
+#ifdef WIN32
+ Sleep(ms);
+#else
+ struct timespec ts = {0, (ogg_int64_t)ms * 1000000LL};
+ nanosleep(&ts, NULL);
+#endif
+}
More information about the commits
mailing list