changeset 658:a9199ee8e5c0 trunk

[svn] - disk writer: do effects processing. - flac113 plugin: pass a valid InputPlayback reference to the thread constructor. closes #797 for real.
author nenolod
date Thu, 15 Feb 2007 23:36:36 -0800
parents f46c9abe09d4
children d1a03def0021
files ChangeLog src/disk_writer/disk_writer.c src/flac113/plugin.c
diffstat 3 files changed, 41 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Feb 15 19:28:20 2007 -0800
+++ b/ChangeLog	Thu Feb 15 23:36:36 2007 -0800
@@ -1,3 +1,11 @@
+2007-02-16 03:28:20 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [1400]
+  - do not unescape streaming uri.
+  
+  trunk/src/xspf/xspf.c |   20 ++++++++++++++------
+  1 file changed, 14 insertions(+), 6 deletions(-)
+
+
 2007-02-16 03:04:53 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1398]
   - disable debugging in preparation for alpha5 release
--- a/src/disk_writer/disk_writer.c	Thu Feb 15 19:28:20 2007 -0800
+++ b/src/disk_writer/disk_writer.c	Thu Feb 15 23:36:36 2007 -0800
@@ -34,6 +34,14 @@
 #include "audacious/util.h"
 #include "audacious/vfs.h"
 
+
+struct format_info { 
+	AFormat format;
+	int frequency;
+	int channels;
+};
+struct format_info input;
+
 struct wavhead
 {
 	guint32 main_chunk;
@@ -193,6 +201,10 @@
 	header.data_length = GUINT32_TO_LE(0);
 	vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
 
+	input.format = fmt;
+	input.frequency = rate;
+	input.channels = nch;
+
 	return 1;
 }
 
@@ -250,6 +262,26 @@
 
 static void disk_write(void *ptr, gint length)
 {
+	AFormat new_format;
+	int new_frequency, new_channels;
+	EffectPlugin *ep;
+
+	new_format = input.format;
+	new_frequency = input.frequency;
+	new_channels = input.channels;
+
+	ep = get_current_effect_plugin();
+	if ( effects_enabled() && ep && ep->query_format ) { 
+		ep->query_format(&new_format,&new_frequency,&new_channels);
+	}
+
+	if ( effects_enabled() && ep && ep->mod_samples ) { 
+		length = ep->mod_samples(&ptr,length,
+					input.format,
+					input.frequency,
+					input.channels );
+	}
+
 	if (afmt == FMT_S8 || afmt == FMT_S16_BE ||
 	    afmt == FMT_U16_LE || afmt == FMT_U16_BE || afmt == FMT_U16_NE)
 		convert_buffer(ptr, length);
--- a/src/flac113/plugin.c	Thu Feb 15 19:28:20 2007 -0800
+++ b/src/flac113/plugin.c	Thu Feb 15 23:36:36 2007 -0800
@@ -337,7 +337,7 @@
 
 	stream_data_.seek_to_in_sec = -1;
 	stream_data_.play_thread_open = true;
-	decode_thread_ = g_thread_create((GThreadFunc)play_loop_, NULL, TRUE, NULL);
+	decode_thread_ = g_thread_create((GThreadFunc)play_loop_, playback, TRUE, NULL);
 }
 
 void FLAC_XMMS__stop(InputPlayback *playback)