changeset 497:dfba4ac44dd8 trunk

[svn] New output driver which makes use of Output objects ability to flush buffers. (seek for output timing, basically)
author nenolod
date Wed, 25 Jan 2006 09:31:04 -0800
parents e52d8e22e718
children 1618a9404868
files Plugins/Input/console/Audacious_Driver.cpp
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/console/Audacious_Driver.cpp	Tue Jan 24 21:47:40 2006 -0800
+++ b/Plugins/Input/console/Audacious_Driver.cpp	Wed Jan 25 09:31:04 2006 -0800
@@ -518,12 +518,16 @@
 		long s = pending_seek;
 		pending_seek = -1; // to do: use atomic swap
 		if ( s >= 0 )
+		{
+			console_ip.output->flush( s * 1000 );
 			track_emu.seek( s * 1000 );
-		
+		}
+
 		// fill buffer
 		if ( track_emu.play( buf_size, buf ) )
 			console_ip_is_going = false;
-		produce_audio( track_emu.tell(), FMT_S16_NE, 1, sizeof buf, buf, NULL );
+		produce_audio( console_ip.output->written_time(), 
+			FMT_S16_NE, 1, sizeof buf, buf, NULL );
 	}
 	
 	// stop playing
@@ -637,7 +641,7 @@
 
 static int get_time(void)
 {
-	return console_ip_is_going ? (track_emu.tell() - 3000 >= 0 ? track_emu.tell() - 3000 : 0) : -1;
+	return console_ip_is_going ? console_ip.output->output_time() : -1;
 }
 
 // Setup