[Freeswitch-svn] [commit] r7384 - in freeswitch/trunk/src/mod/formats: mod_local_stream mod_native_file mod_shout mod_sndfile

Freeswitch SVN brian at freeswitch.org
Sat Jan 26 22:14:28 EST 2008


Author: brian
Date: Sat Jan 26 22:14:27 2008
New Revision: 7384

Modified:
   freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
   freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c
   freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
   freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c

Log:
formats cleanup

Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c	(original)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c	Sat Jan 26 22:14:27 2008
@@ -56,6 +56,7 @@
 	int line;
 	struct local_stream_context *next;
 };
+
 typedef struct local_stream_context local_stream_context_t;
 
 struct local_stream_source {
@@ -74,6 +75,7 @@
 	switch_memory_pool_t *pool;
 	int shuffle;
 };
+
 typedef struct local_stream_source local_stream_source_t;
 
 static unsigned int S = 0;

Modified: freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c	(original)
+++ freeswitch/trunk/src/mod/formats/mod_native_file/mod_native_file.c	Sat Jan 26 22:14:27 2008
@@ -69,8 +69,6 @@
 		return SWITCH_STATUS_GENERR;
 	}
 
-
-
 	handle->samples = 0;
 	handle->samplerate = 8000;
 	handle->channels = 1;
@@ -82,7 +80,6 @@
 	handle->flags |= SWITCH_FILE_NATIVE;
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Opening File [%s] %dhz\n", path, handle->samplerate);
 
-
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -105,7 +102,6 @@
 	switch_file_seek(context->fd, whence, &samples);
 
 	return SWITCH_STATUS_FALSE;
-
 }
 
 static switch_status_t native_file_file_read(switch_file_handle_t *handle, void *data, size_t *len)
@@ -138,7 +134,6 @@
 
 static char *supported_formats[SWITCH_MAX_CODECS] = { 0 };
 
-
 SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
 {
 	switch_file_interface_t *file_interface;

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	Sat Jan 26 22:14:27 2008
@@ -70,7 +70,6 @@
 
 typedef struct shout_context shout_context_t;
 
-
 static size_t decode_fd(shout_context_t * context, void *data, size_t bytes);
 
 static inline void free_context(shout_context_t * context)
@@ -128,7 +127,6 @@
 	}
 }
 
-
 static void log_error(char const *fmt, va_list ap)
 {
 	char *data = NULL;
@@ -287,7 +285,6 @@
 
 		} while (decode_status != MP3_NEED_MORE);
 
-
 		if (context->audio_buffer) {
 			switch_buffer_write(context->audio_buffer, context->decode_buf, usedlen);
 		} else {
@@ -311,7 +308,6 @@
 	context->err++;
 	switch_mutex_unlock(context->audio_mutex);
 	return 0;
-
 }
 
 #define error_check() if (context->err) goto error;
@@ -424,7 +420,6 @@
 	context->err++;
 	switch_mutex_unlock(context->audio_mutex);
 	return 0;
-
 }
 
 
@@ -804,7 +799,6 @@
 	int16_t *audio = data;
 	int nsamples = *len;
 
-
 	if (context->shout && !context->shout_init) {
 		context->shout_init++;
 		if (shout_open(context->shout) != SHOUTERR_SUCCESS) {
@@ -941,7 +935,6 @@
 	return SWITCH_STATUS_FALSE;
 }
 
-
 static switch_bool_t telecast_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
 {
     switch_buffer_t *buffer = (switch_buffer_t *) user_data;
@@ -993,7 +986,6 @@
     char title_aft[128*3] = "";
     char *mp3, *m3u;
 
-
     /*
       0  uuid  VARCHAR(255),
       1  created  VARCHAR(255),
@@ -1011,8 +1003,6 @@
       13 write_rate  VARCHAR(255)
     */
     
-
-
     holder->stream->write_function(holder->stream, 
                                    "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>", 
                                    argv[1], argv[4], argv[5], argv[7], argv[8] ? argv[8] : "N/A", argv[9] ? argv[9] : "N/A", argv[10], argv[11]);
@@ -1031,7 +1021,6 @@
     return 0;
 }
 
-
 void do_telecast(switch_stream_handle_t *stream)
 {
     char *path_info = switch_event_get_header(stream->event, "http-path-info");
@@ -1047,7 +1036,6 @@
         char *ref = switch_event_get_header(stream->event, "http-referer");
         stream->write_function(stream,"Content-type: text/html\r\n\r\n<h2>Not Found!</h2>\n"
                                "<META http-equiv=\"refresh\" content=\"1;URL=%s\">",  ref);
-
     } else {
         switch_media_bug_t *bug = NULL;
         switch_buffer_t *buffer;
@@ -1056,7 +1044,6 @@
         lame_global_flags *gfp = NULL;
         switch_codec_t *read_codec;
         
-
         if (!(gfp = lame_init())) {
             switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate lame\n");
             goto end;
@@ -1108,7 +1095,6 @@
                 memset(buf, 0, bytes);
             }
             
-
             if ((rlen = lame_encode_buffer(gfp, (void *)buf, NULL, bytes / 2, mp3buf, sizeof(mp3buf))) < 0) {
                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
                 goto end;
@@ -1122,7 +1108,6 @@
             }
         }
 
-
     end:
 
         switch_safe_free(uuid);
@@ -1142,10 +1127,8 @@
 
         switch_core_session_rwunlock(tsession);
     }
-
 }
 
-
 void do_broadcast(switch_stream_handle_t *stream)
 {
     char *path_info = switch_event_get_header(stream->event, "http-path-info");
@@ -1204,7 +1187,6 @@
                            "Content-Disposition: inline; filename=\"%s.mp3\"\r\n\r\n", 
                            path_info + 7);
 
-
     if (fh.interval) {
         interval = fh.interval * 1000;
     }
@@ -1233,11 +1215,8 @@
                 goto end;
             }
         }
-
-
     }
 
-
     while ((rlen = lame_encode_flush(gfp, mp3buf, sizeof(mp3buf))) > 0) {
         if (stream->raw_write_function(stream, mp3buf, rlen)) {
             switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Disconnected\n");
@@ -1245,7 +1224,6 @@
         }
     }
 
-
  end:
 
     if (fh.channels) {
@@ -1257,11 +1235,9 @@
     if (gfp) {
         lame_close(gfp);
         gfp = NULL;
-    }
-            
+    }            
 }
 
-
 void do_index(switch_stream_handle_t *stream)
 {
     switch_core_db_t *db = switch_core_db_handle();
@@ -1275,8 +1251,6 @@
     holder.stream = stream;
     
     stream->write_function(stream, "Content-type: text/html\r\n\r\n");
-
-
     stream->write_function(stream,
                            "<table align=center border=1 cellpadding=6 cellspacing=0>"
                            "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
@@ -1295,13 +1269,11 @@
 }
 
 #define TELECAST_SYNTAX ""
-
 SWITCH_STANDARD_API(telecast_api_function)
 {
     char *host = NULL, *port = NULL, *uri = NULL, *path_info = NULL;
 
-    
-	if (session) {
+   	if (session) {
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -1369,8 +1341,6 @@
     file_interface->file_set_string = shout_file_set_string;
     file_interface->file_get_string = shout_file_get_string;
 
-
-
 	/* connect my internal structure to the blank pointer passed to me */
 	//*module_interface = &shout_module_interface;
 
@@ -1383,7 +1353,6 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown)
 {
 	curl_global_cleanup();

Modified: freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c	(original)
+++ freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c	Sat Jan 26 22:14:27 2008
@@ -71,7 +71,6 @@
 	}
 	ext++;
 
-
 	if (switch_test_flag(handle, SWITCH_FILE_FLAG_READ)) {
 		mode += SFM_READ;
 	}
@@ -177,13 +176,11 @@
 	handle->seekable = context->sfinfo.seekable;
 	handle->speed = 0;
 	handle->private_info = context;
-		
 
  end:
 	
 	switch_safe_free(alt_path);
 	switch_safe_free(ldup);
-	
 
 	return status;
 }
@@ -210,7 +207,6 @@
 	handle->pos = *cur_sample;
 
 	return SWITCH_STATUS_SUCCESS;
-
 }
 
 static switch_status_t sndfile_file_read(switch_file_handle_t *handle, void *data, size_t *len)
@@ -302,7 +298,6 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
-
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "\nLibSndFile Version : %s Supported Formats\n", buffer);
 	switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "================================================================================\n");
 	sf_command(NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof(int));
@@ -355,14 +350,11 @@
 			   }
 			 */
 		}
-
 	}
 	for (m = 0; m < exlen; m++) {
 		supported_formats[len++] = extras[m];
 	}
 
-
-
 	switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_NOTICE, "================================================================================\n");
 
 	return SWITCH_STATUS_SUCCESS;



More information about the Freeswitch-svn mailing list