[Freeswitch-svn] [commit] r9881 - freeswitch/trunk/src/mod/formats/mod_shout

Freeswitch SVN anthm at freeswitch.org
Tue Oct 7 16:59:54 EDT 2008


Author: anthm
Date: Tue Oct  7 16:59:54 2008
New Revision: 9881

Modified:
   freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c

Log:
noom noom noom

Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c	(original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c	Tue Oct  7 16:59:54 2008
@@ -47,6 +47,28 @@
 
 static char *supported_formats[SWITCH_MAX_CODECS] = { 0 };
 
+mpg123_handle *our_mpg123_new(const char* decoder, int *error) 
+{
+	mpg123_handle *mh;
+	const char *arch = "auto";
+	int x64 = 0;
+
+	if (sizeof(void *) == 4) {
+		arch = "i586";
+	} else {
+		x64++;
+	}
+
+	if ((mh = mpg123_new(arch, NULL))) {
+		if (x64) {
+			mpg123_param(mh, MPG123_OUTSCALE, 8192, 0);
+		}
+	}
+
+	return mh;
+}
+
+
 struct shout_context {
 	shout_t *shout;
 	lame_global_flags *gfp;
@@ -414,7 +436,7 @@
 			}
 
 			mpg123_close(context->mh);
-			context->mh = mpg123_new(NULL, NULL);
+			context->mh = our_mpg123_new(NULL, NULL);
 			mpg123_open_feed(context->mh);
 			mpg123_param(context->mh, MPG123_FORCE_RATE, context->samplerate, 0);
 			mpg123_param(context->mh, MPG123_FLAGS, MPG123_MONO_MIX, 0);
@@ -607,16 +629,10 @@
 		}
 
 		switch_mutex_init(&context->audio_mutex, SWITCH_MUTEX_NESTED, context->memory_pool);
-		context->mh = mpg123_new(NULL, NULL);
+		context->mh = our_mpg123_new(NULL, NULL);
 		mpg123_open_feed(context->mh);
 		mpg123_format_all(context->mh);
-		mpg123_param(context->mh, MPG123_FORCE_RATE, context->samplerate, 0);
-		//mpg123_param(context->mh, MPG123_DOWN_SAMPLE, 1, 0);
-		if (sizeof(void *) == 4) {
-			mpg123_param(context->mh, MPG123_OUTSCALE, 8, 0);
-		} else {
-			mpg123_param(context->mh, MPG123_OUTSCALE, 8192, 0);
-		}
+		mpg123_param(context->mh, MPG123_FORCE_RATE, context->samplerate, 0);		
 
 		if (handle->handler) {
 			mpg123_param(context->mh, MPG123_FLAGS, MPG123_SEEKBUFFER|MPG123_MONO_MIX, 0);
@@ -808,7 +824,7 @@
 			}
 
 			mpg123_close(context->mh);
-			context->mh = mpg123_new(NULL, NULL);
+			context->mh = our_mpg123_new(NULL, NULL);
 			mpg123_open_feed(context->mh);
 			mpg123_param(context->mh, MPG123_FORCE_RATE, context->samplerate, 0);
 			mpg123_param(context->mh, MPG123_FLAGS, MPG123_MONO_MIX, 0);



More information about the Freeswitch-svn mailing list