diff src/audiocompress/audacious-glue.c @ 2575:1e67df1a1edc

Implemented query_format() callback in all effect plugins
author Stefano D'Angelo <zanga.mail@gmail.com>
date Mon, 19 May 2008 01:52:11 +0200
parents 769e17da93dd
children bd3a24b39058
line wrap: on
line diff
--- a/src/audiocompress/audacious-glue.c	Sun May 18 16:59:05 2008 +0200
+++ b/src/audiocompress/audacious-glue.c	Mon May 19 01:52:11 2008 +0200
@@ -37,6 +37,7 @@
 static void myPrefs(void);
 static int myModify(gpointer * data, gint length, AFormat fmt,
 		    gint srate, gint nch);
+static void myQueryFormat(AFormat * fmt, gint * rate, gint * nch);
 
 static int inited = 0;
 
@@ -48,6 +49,7 @@
 	.about = myAbout,
 	.configure = myPrefs,
 	.mod_samples = myModify,
+	.query_format = myQueryFormat,
 };
 
 EffectPlugin *audiocompress_eplist[] = { &xmms_plugin, NULL };
@@ -76,6 +78,14 @@
         inited = 0;
 }
 
+void myQueryFormat(AFormat * fmt, gint * rate, gint * nch)
+{
+	if ((*fmt != FMT_S16_NE) ||
+	    (*fmt != FMT_S16_LE && G_BYTE_ORDER == G_LITTLE_ENDIAN) ||
+	    (*fmt != FMT_S16_BE && G_BYTE_ORDER == G_BIG_ENDIAN))
+		*fmt = FMT_S16_NE;
+}
+
 int myModify(gpointer * data, gint length, AFormat fmt, gint srate, gint nch)
 {
 	if (fmt == FMT_S16_NE ||