[xiph-commits] r2873 - liboggplay/trunk/plugin
tahn at svn.annodex.net
tahn at svn.annodex.net
Thu Jun 7 22:19:50 PDT 2007
Author: tahn
Date: 2007-06-07 22:19:49 -0700 (Thu, 07 Jun 2007)
New Revision: 2873
Modified:
liboggplay/trunk/plugin/plugin_gui_linux.c
Log:
Use oggplay's current time function.
Modified: liboggplay/trunk/plugin/plugin_gui_linux.c
===================================================================
--- liboggplay/trunk/plugin/plugin_gui_linux.c 2007-06-08 04:54:01 UTC (rev 2872)
+++ liboggplay/trunk/plugin/plugin_gui_linux.c 2007-06-08 05:19:49 UTC (rev 2873)
@@ -81,18 +81,6 @@
void * tools_handle;
} PluginWindowInfo;
-/** returns current time in ms */
-int64_t get_curr_time() {
- int64_t _time;
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
- _time = tv.tv_sec;
- _time *= 1000;
- _time += (tv.tv_usec / 1000);
- return _time;
-}
-
void
open_audio(PluginWindowInfo *info) {
int err;
@@ -167,7 +155,7 @@
if (info->audio_opened == FALSE)
#endif
{
- info->playback_target = get_curr_time();
+ info->playback_target = oggplay_sys_time_in_ms();
}
if (frame_data.cmml_strings != NULL) {
@@ -188,13 +176,13 @@
)
{
printf("Error writing audio samples\n");
- cur_time = get_curr_time();
+ cur_time = oggplay_sys_time_in_ms();
}
/* get audio playback progress */
else if (sa_device_get_position(info->audio_handle,
SA_PCM_WRITE_SOFTWARE_POS, &bytes) > 0) {
printf("Error reading the playback position\n");
- cur_time = get_curr_time();
+ cur_time = oggplay_sys_time_in_ms();
} else {
cur_time = (bytes * 1000 / get_audio_rate(info->ogg_handle) /
(sizeof(short) * get_audio_channels(info->ogg_handle)));
@@ -203,7 +191,7 @@
else
#endif
{
- cur_time = get_curr_time();
+ cur_time = oggplay_sys_time_in_ms();
}
/* clean up */
More information about the commits
mailing list