changeset 66:f04b33512c3d trunk

[svn] - get_time() implementation
author nenolod
date Sat, 30 Sep 2006 22:44:36 -0700
parents d54fa96988b3
children 41e2dc106f4e
files ChangeLog src/alac/plugin.c
diffstat 2 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 30 22:05:07 2006 -0700
+++ b/ChangeLog	Sat Sep 30 22:44:36 2006 -0700
@@ -1,3 +1,11 @@
+2006-10-01 05:05:07 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [130]
+  - correct formatting issue
+  
+  trunk/src/wma/wma.c |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2006-10-01 05:03:52 +0000  William Pitcock <nenolod@nenolod.net>
   revision [128]
   - remove some spurious debugging notices
--- a/src/alac/plugin.c	Sat Sep 30 22:05:07 2006 -0700
+++ b/src/alac/plugin.c	Sat Sep 30 22:44:36 2006 -0700
@@ -48,6 +48,7 @@
 
 gpointer decode_thread(void *args);
 static GThread *playback_thread;
+static int going = 0;
 
 extern void set_endian();
 
@@ -103,6 +104,14 @@
 	/* unimplemented */
 }
 
+static gint get_time(void)
+{
+    if (going)
+	return get_output_time();
+    else
+	return -1;
+}
+
 InputPlugin alac_ip = {
     NULL,
     NULL,
@@ -117,7 +126,7 @@
     output_pause,
     seek,
     NULL,
-    get_output_time,
+    get_time,
     NULL,
     NULL,
     NULL,
@@ -171,7 +180,6 @@
     unsigned long destBufferSize = 1024*16; /* 16kb buffer = 4096 frames = 1 alac sample */
     void *pDestBuffer = malloc(destBufferSize);
     int bytes_read = 0;
-    int going = 1;
 
     unsigned int buffer_size = 1024*128;
     void *buffer;
@@ -254,9 +262,13 @@
     alac_ip.output->open_audio(FMT_S16_LE, demux_res.sample_rate, demux_res.num_channels);
     alac_ip.set_info((char *) args, -1, -1, demux_res.sample_rate, demux_res.num_channels);
 
+    going = 1;
+
     /* will convert the entire buffer */
     GetBuffer(&demux_res);
 
+    going = 0;
+
     stream_destroy(input_stream);
 
     if (input_opened)