changeset 2276:d25cd7e7eddb

append '\n' to format string for AUDDBG()
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Tue, 01 Jan 2008 23:12:46 +0900
parents e09d9633d6aa
children 614f7b9838fb
files src/madplug/decoder.c src/madplug/input.c src/madplug/plugin.c src/madplug/replaygain.c
diffstat 4 files changed, 90 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/src/madplug/decoder.c	Tue Jan 01 22:54:10 2008 +0900
+++ b/src/madplug/decoder.c	Tue Jan 01 23:12:46 2008 +0900
@@ -196,8 +196,8 @@
         info->fileinfo_request = FALSE;
     }
 
-    AUDDBG("f: scan_file");
-    AUDDBG("scan_file frames = %d", info->frames);
+    AUDDBG("f: scan_file\n");
+    AUDDBG("scan_file frames = %d\n", info->frames);
 
     while (1) {
         remainder = stream.bufend - stream.next_frame;
@@ -214,7 +214,7 @@
                              BUFFER_SIZE - remainder);
 
         if (len <= 0) {
-            AUDDBG("scan_file: len <= 0 len = %d", len);
+            AUDDBG("scan_file: len <= 0 len = %d\n", len);
             break;
         }
 
@@ -226,10 +226,10 @@
                     break;
                 }
                 if (!MAD_RECOVERABLE(stream.error)) {
-                    AUDDBG("(fatal) error decoding header %d: %s",
+                    AUDDBG("(fatal) error decoding header %d: %s\n",
                               info->frames, mad_stream_errorstr(&stream));
-                    AUDDBG("remainder = %d", remainder);
-                    AUDDBG("len = %d", len);
+                    AUDDBG("remainder = %d\n", remainder);
+                    AUDDBG("len = %d\n", len);
                     break;
                 }
                 if (stream.error == MAD_ERROR_LOSTSYNC) {
@@ -238,27 +238,27 @@
                                             stream.bufend -
                                             stream.this_frame);
                     if (tagsize > 0) {
-                        AUDDBG("skipping id3_tag: %d", tagsize);
+                        AUDDBG("skipping id3_tag: %d\n", tagsize);
                         mad_stream_skip(&stream, tagsize);
                         continue;
                     }
                 }
 
-                AUDDBG("(recovered) error decoding header %d: %s",
+                AUDDBG("(recovered) error decoding header %d: %s\n",
                           info->frames, mad_stream_errorstr(&stream));
-                AUDDBG("remainder = %d", remainder);
-                AUDDBG("len = %d", len);
+                AUDDBG("remainder = %d\n", remainder);
+                AUDDBG("len = %d\n", len);
 
                 continue;
             }
             info->frames++;
 
 #ifdef DEBUG_INTENSIVELY
-            AUDDBG("header bitrate = %ld", header.bitrate);
-            AUDDBG("duration = %ul",
+            AUDDBG("header bitrate = %ld\n", header.bitrate);
+            AUDDBG("duration = %ul\n",
                       mad_timer_count(header.duration,
                                       MAD_UNITS_MILLISECONDS));
-            AUDDBG("size = %d", stream.next_frame - stream.this_frame);
+            AUDDBG("size = %d\n", stream.next_frame - stream.this_frame);
 #endif
             if(aud_tuple_get_int(info->tuple, FIELD_LENGTH, NULL) == -1)
                 mad_timer_add(&info->duration, header.duration);
@@ -280,15 +280,15 @@
                 if (audmad_config.use_xing) {
                     frame.header = header;
                     if (mad_frame_decode(&frame, &stream) == -1) {
-                        AUDDBG("xing frame decode failed");
+                        AUDDBG("xing frame decode failed\n");
                         goto no_xing;
                     }
                     if (xing_parse(&info->xing, stream.anc_ptr, stream.anc_bitlen) == 0) {
-                        AUDDBG("xing header found ");
+                        AUDDBG("xing header found\n");
                         has_xing = TRUE;
                         info->vbr = TRUE;   /* otherwise xing header would have been 'Info' */
 
-                        AUDDBG("xing: bytes = %ld frames = %ld", info->xing.bytes, info->xing.frames);
+                        AUDDBG("xing: bytes = %ld frames = %ld\n", info->xing.bytes, info->xing.frames);
 
                         /* we have enough info to calculate bitrate and duration */
                         if(info->xing.bytes && info->xing.frames) {
@@ -296,8 +296,8 @@
 #ifdef AUD_DEBUG
                             {
                                 gint tmp = (gint)(info->xing.bytes * 8 / xing_bitrate);
-                                AUDDBG("xing: bitrate = %4.1f kbps", xing_bitrate / 1000);
-                                AUDDBG("xing: duration = %d:%02d", tmp / 60, tmp % 60);
+                                AUDDBG("xing: bitrate = %4.1f kbps\n", xing_bitrate / 1000);
+                                AUDDBG("xing: duration = %d:%02d\n", tmp / 60, tmp % 60);
                             }
 #endif
                         }
@@ -305,7 +305,7 @@
                     }
 #ifdef AUD_DEBUG
                     else {
-                        AUDDBG("no usable xing header");
+                        AUDDBG("no usable xing header\n");
                         continue;
                     }
 #endif
@@ -332,14 +332,14 @@
             if (fast && info->frames >= N_AVERAGE_FRAMES) {
                 float frame_size = ((double) data_used) / N_AVERAGE_FRAMES;
 
-                AUDDBG("bitrate = %ld samplerate = %d", header.bitrate, header.samplerate);
-                AUDDBG("data_used = %d info->frames = %d info->size = %d tagsize = %d frame_size = %lf",
+                AUDDBG("bitrate = %ld samplerate = %d\n", header.bitrate, header.samplerate);
+                AUDDBG("data_used = %d info->frames = %d info->size = %d tagsize = %d frame_size = %lf\n",
                           data_used, info->frames, info->size, tagsize, frame_size);
 
                 if(info->size != 0)
                     info->frames = (info->size - tagsize) / frame_size;
 
-                AUDDBG("info->frames = %d", info->frames);
+                AUDDBG("info->frames = %d\n", info->frames);
 
                 if(aud_tuple_get_int(info->tuple, FIELD_LENGTH, NULL) == -1) {
                     if(xing_bitrate > 0.0) {
@@ -361,14 +361,14 @@
                     info->duration.fraction = length % 1000;
                 }
 #ifdef AUD_DEBUG
-                AUDDBG("using fast playtime calculation");
-                AUDDBG("data used = %d [tagsize=%d framesize=%f]",
+                AUDDBG("using fast playtime calculation\n");
+                AUDDBG("data used = %d [tagsize=%d framesize=%f]\n",
                           data_used, tagsize, frame_size);
-                AUDDBG("frames = %d, frequency = %d, channels = %d",
+                AUDDBG("frames = %d, frequency = %d, channels = %d\n",
                           info->frames, info->freq, info->channels);
                 long millis = mad_timer_count(info->duration,
                                               MAD_UNITS_MILLISECONDS);
-                AUDDBG("duration = %ld:%02ld", millis / 1000 / 60, (millis / 1000) % 60);
+                AUDDBG("duration = %ld:%02ld\n", millis / 1000 / 60, (millis / 1000) % 60);
 #endif                          /* DEBUG */
                 break;
             }
@@ -392,8 +392,8 @@
     mad_stream_finish(&stream);
     xing_finish(&info->xing);
 
-    AUDDBG("scan_file: info->frames = %d", info->frames);
-    AUDDBG("e: scan_file");
+    AUDDBG("scan_file: info->frames = %d\n", info->frames);
+    AUDDBG("e: scan_file\n");
 
     return (info->frames != 0 || info->remote == TRUE);
 }
@@ -428,7 +428,7 @@
     /* track info is passed in as thread argument */
     struct mad_info_t *info = (struct mad_info_t *) arg;
 
-    AUDDBG("f: decode");
+    AUDDBG("f: decode\n");
 
     /* init mad stuff */
     mad_frame_init(&frame);
@@ -437,11 +437,11 @@
     mad_synth_init(&synth);
 
     if(!info->playback){
-        AUDDBG("decode: playback == NULL");
+        AUDDBG("decode: playback == NULL\n");
         return NULL;
     }
 
-    AUDDBG("decode: fmt = %d freq = %d channels = %d", info->fmt, info->freq, info->channels);
+    AUDDBG("decode: fmt = %d freq = %d channels = %d\n", info->fmt, info->freq, info->channels);
 
     if(check_audio_param(info) == FALSE)
         return NULL;
@@ -467,12 +467,12 @@
                              (tlen == 0 || info->size <= 0) ? -1 : tlen,
                              info->bitrate, info->freq, info->channels);
 
-    AUDDBG("decode: tlen = %d", tlen);
+    AUDDBG("decode: tlen = %d\n", tlen);
 
     /* main loop */
     do {
         if (!info->playback->playing) {
-            AUDDBG("decode: stop signaled");
+            AUDDBG("decode: stop signaled\n");
             break;
         }
         if (seek_skip)
@@ -487,7 +487,7 @@
         input_process_remote_metadata(info);
 
         if (len <= 0) {
-            AUDDBG("finished decoding");
+            AUDDBG("finished decoding\n");
             break;
         }
         len += remainder;
@@ -502,7 +502,7 @@
 
         if (seek_skip) {
 
-            AUDDBG("skipping: %d", seek_skip);
+            AUDDBG("skipping: %d\n", seek_skip);
 
             int skip = 2;
             do {
@@ -526,7 +526,7 @@
         while (info->playback->playing) {
             if (info->seek != -1 && info->size > 0) {
 
-                AUDDBG("seeking: %ld", info->seek);
+                AUDDBG("seeking: %ld\n", info->seek);
 
                 int new_position;
                 gulong milliseconds =
@@ -541,7 +541,7 @@
                 if(new_position < 0)
                     new_position = 0;
 
-                AUDDBG("seeking to: %d bytes", new_position);
+                AUDDBG("seeking to: %d bytes\n", new_position);
 
                 if (aud_vfs_fseek(info->infile, new_position, SEEK_SET) == -1)
                     audmad_error("failed to seek to: %d", new_position);
@@ -570,7 +570,7 @@
                     }
                 }
 
-                AUDDBG("(recovered) error decoding header %d: %s",
+                AUDDBG("(recovered) error decoding header %d: %s\n",
                           info->current_frame,
                           mad_stream_errorstr(&stream));
 
@@ -582,7 +582,7 @@
             if (!audmad_config.show_avg_vbr_bitrate && info->vbr && (iteration % 40 == 0)) {
 
 #ifdef DEBUG_INTENSIVELY
-                AUDDBG("decode vbr tlen = %d", tlen);
+                AUDDBG("decode vbr tlen = %d\n", tlen);
 #endif
                 info->playback->set_params(info->playback, info->title,
                                      (tlen == 0 || info->size <= 0) ? -1 : tlen,
@@ -594,7 +594,7 @@
                 if (!MAD_RECOVERABLE(stream.error))
                     break;
 
-                AUDDBG("(recovered) error decoding frame %d: %s",
+                AUDDBG("(recovered) error decoding frame %d: %s\n",
                           info->current_frame,
                           mad_stream_errorstr(&stream));
 
@@ -606,10 +606,10 @@
                 || info->channels !=
                 (guint) MAD_NCHANNELS(&frame.header)) {
 
-                AUDDBG("change in audio type detected");
-                AUDDBG("old: frequency = %d, channels = %d", info->freq,
+                AUDDBG("change in audio type detected\n");
+                AUDDBG("old: frequency = %d, channels = %d\n", info->freq,
                           info->channels);
-                AUDDBG("new: frequency = %d, channels = %d",
+                AUDDBG("new: frequency = %d, channels = %d\n",
                           frame.header.samplerate,
                           (guint) MAD_NCHANNELS(&frame.header));
 
@@ -619,7 +619,7 @@
                 if(audmad_config.force_reopen_audio && check_audio_param(info)) {
                     gint current_time = info->playback->output->output_time();
 
-                    AUDDBG("re-opening audio due to change in audio type");
+                    AUDDBG("re-opening audio due to change in audio type\n");
 
                     info->playback->output->close_audio();
                     if (!info->playback->output->open_audio(info->fmt, info->freq,
@@ -660,7 +660,7 @@
         info->playback->output->buffer_free();
         while (info->playback->output->buffer_playing()) {
 
-            AUDDBG("f: buffer_playing=%d", info->playback->output->buffer_playing());
+            AUDDBG("f: buffer_playing=%d\n", info->playback->output->buffer_playing());
 
             g_get_current_time(&sleeptime);
             g_time_val_add(&sleeptime, 500000);
@@ -675,7 +675,7 @@
         }
     }
 
-    AUDDBG("e: decode");
+    AUDDBG("e: decode\n");
 
     aud_tuple_free(info->tuple);
     info->tuple = NULL;
--- a/src/madplug/input.c	Tue Jan 01 22:54:10 2008 +0900
+++ b/src/madplug/input.c	Tue Jan 01 23:12:46 2008 +0900
@@ -71,7 +71,7 @@
  */
 gboolean input_init(struct mad_info_t * info, const char *url, VFSFile *fd)
 {
-    AUDDBG("f: input_init");
+    AUDDBG("f: input_init\n");
 
     memset(info, 0, sizeof(struct mad_info_t)); // all fields are cleared to 0 --yaz
 
@@ -112,8 +112,8 @@
 
     info->fileinfo_request = FALSE;
 
-    AUDDBG("i: info->size = %lu", (long unsigned int)info->size);
-    AUDDBG("e: input_init");
+    AUDDBG("i: info->size = %lu\n", (long unsigned int)info->size);
+    AUDDBG("e: input_init\n");
 
     return TRUE;
 }
@@ -345,7 +345,7 @@
     Tuple *tuple;
     glong curpos = 0;
 
-    AUDDBG("f: input_read_tag");
+    AUDDBG("f: input_read_tag\n");
 
     if (info->tuple != NULL)
         aud_tuple_free(info->tuple);
@@ -362,13 +362,13 @@
     }
 
     if (!info->id3file) {
-        AUDDBG("read_tag: no id3file");
+        AUDDBG("read_tag: no id3file\n");
         return;
     }
 
     info->tag = id3_file_tag(info->id3file);
     if (!info->tag) {
-        AUDDBG("read_tag: no tag");
+        AUDDBG("read_tag: no tag\n");
         return;
     }
 
@@ -401,7 +401,7 @@
     string = input_id3_get_string(info->tag, "TLEN");
     if (string) {
         aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, atoi(string));
-        AUDDBG("input_read_tag: TLEN = %d", atoi(string));
+        AUDDBG("input_read_tag: TLEN = %d\n", atoi(string));
         g_free(string);
         string = NULL;
     } else
@@ -419,7 +419,7 @@
         aud_vfs_fseek(info->infile, curpos, SEEK_SET);
     }
     
-    AUDDBG("e: input_read_tag");
+    AUDDBG("e: input_read_tag\n");
 }
 
 void input_process_remote_metadata(struct mad_info_t *info)
@@ -430,7 +430,7 @@
         gchar *tmp = NULL;
 
 #ifdef DEBUG_INTENSIVELY
-        AUDDBG("process_remote_meta");
+        AUDDBG("process_remote_meta\n");
 #endif
         g_free(info->title);
         info->title = NULL;
@@ -500,7 +500,7 @@
 {
 #ifdef AUD_DEBUG
     gchar *tmp = g_filename_to_utf8(info->filename, -1, NULL, NULL, NULL);    
-    AUDDBG("f: input_get_info: %s, fast_scan = %s", tmp, fast_scan ? "TRUE" : "FALSE");
+    AUDDBG("f: input_get_info: %s, fast_scan = %s\n", tmp, fast_scan ? "TRUE" : "FALSE");
     g_free(tmp);
 #endif                          /* DEBUG */
 
@@ -513,7 +513,7 @@
 
     /* scan mp3 file, decoding headers */
     if (scan_file(info, fast_scan) == FALSE) {
-        AUDDBG("input_get_info: scan_file failed");
+        AUDDBG("input_get_info: scan_file failed\n");
         return FALSE;
     }
 
@@ -530,7 +530,7 @@
             info->title = g_strdup(info->filename); //XXX info->filename is uri. --yaz
     }
 
-    AUDDBG("e: input_get_info");
+    AUDDBG("e: input_get_info\n");
     return TRUE;
 }
 
@@ -549,7 +549,7 @@
 {
     int len = 0;
 #ifdef DEBUG_INTENSIVELY
-  AUDDBG ("f: input_get_data: %d", buffer_size);
+  AUDDBG ("f: input_get_data: %d\n", buffer_size);
 #endif
     /* simply read to data from the file */
     len = aud_vfs_fread(buffer, 1, buffer_size, info->infile); //aud_vfs_fread returns num of elements.
@@ -559,7 +559,7 @@
     }
 
 #ifdef DEBUG_INTENSIVELY
-    AUDDBG ("e: input_get_data: size=%d offset=%d", len, info->offset);
+    AUDDBG ("e: input_get_data: size=%d offset=%d\n", len, info->offset);
 #endif
 
     info->offset += len;
@@ -571,7 +571,7 @@
  */
 gboolean input_term(struct mad_info_t * info)
 {
-    AUDDBG("f: input_term");
+    AUDDBG("f: input_term\n");
 
     if (info->title)
         g_free(info->title);
@@ -608,7 +608,7 @@
     /* set everything to zero in case it gets used again. */
     memset(info, 0, sizeof(struct mad_info_t));
 
-    AUDDBG("e: input_term");
+    AUDDBG("e: input_term\n");
 
     return TRUE;
 }
--- a/src/madplug/plugin.c	Tue Jan 01 22:54:10 2008 +0900
+++ b/src/madplug/plugin.c	Tue Jan 01 23:12:46 2008 +0900
@@ -104,14 +104,14 @@
     else
       x = 0;
     config->pregain_scale = (x != 0) ? pow(10.0, x / 20) : 1;
-    AUDDBG("pregain=[%s] -> %g  -> %g", text, x, config->pregain_scale);
+    AUDDBG("pregain=[%s] -> %g  -> %g\n", text, x, config->pregain_scale);
     text = config->replaygain.default_db;
     if ( text != NULL )
       x = g_strtod(text, NULL);
     else
       x = 0;
     config->replaygain.default_scale = (x != 0) ? pow(10.0, x / 20) : 1;
-    AUDDBG("RG.default=[%s] -> %g  -> %g", text, x,
+    AUDDBG("RG.default=[%s] -> %g  -> %g\n", text, x,
               config->replaygain.default_scale);
 }
 
@@ -403,7 +403,7 @@
 
 static void audmad_stop(InputPlayback *playback)
 {
-    AUDDBG("f: audmad_stop");
+    AUDDBG("f: audmad_stop\n");
     g_mutex_lock(mad_mutex);
     info.playback = playback;
     g_mutex_unlock(mad_mutex);
@@ -415,15 +415,15 @@
         g_mutex_unlock(mad_mutex);
         g_cond_signal(mad_cond);
 
-        AUDDBG("waiting for thread");
+        AUDDBG("waiting for thread\n");
         g_thread_join(decode_thread);
-        AUDDBG("thread done");
+        AUDDBG("thread done\n");
 
         input_term(&info);
         decode_thread = NULL;
 
     }
-    AUDDBG("e: audmad_stop");
+    AUDDBG("e: audmad_stop\n");
 }
 
 static void audmad_play_file(InputPlayback *playback)
@@ -434,7 +434,7 @@
 #ifdef AUD_DEBUG
     {
         gchar *tmp = g_filename_to_utf8(url, -1, NULL, NULL, NULL);
-        AUDDBG("playing %s", tmp);
+        AUDDBG("playing %s\n", tmp);
         g_free(tmp);
     }
 #endif                          /* DEBUG */
@@ -496,12 +496,12 @@
     struct mad_info_t myinfo;
 #ifdef AUD_DEBUG
     gchar *tmp = g_filename_to_utf8(url, -1, NULL, NULL, NULL);
-    AUDDBG("f: audmad_get_song_info: %s", tmp);
+    AUDDBG("f: audmad_get_song_info: %s\n", tmp);
     g_free(tmp);
 #endif                          /* DEBUG */
 
     if (input_init(&myinfo, url, NULL) == FALSE) {
-        AUDDBG("error initialising input");
+        AUDDBG("error initialising input\n");
         return;
     }
 
@@ -520,17 +520,17 @@
         *length = -1;
     }
     input_term(&myinfo);
-    AUDDBG("e: audmad_get_song_info");
+    AUDDBG("e: audmad_get_song_info\n");
 }
 
 static gboolean
 audmad_fill_info(struct mad_info_t *info, VFSFile *fd)
 {
     if (fd == NULL || info == NULL) return FALSE;
-    AUDDBG("f: audmad_fill_info(): %s", fd->uri);
+    AUDDBG("f: audmad_fill_info(): %s\n", fd->uri);
 
     if (input_init(info, fd->uri, fd) == FALSE) {
-        AUDDBG("audmad_fill_info(): error initialising input");
+        AUDDBG("audmad_fill_info(): error initialising input\n");
         return FALSE;
     }
     
@@ -621,7 +621,7 @@
 
 #ifdef AUD_DEBUG
     string = aud_str_to_utf8(filename);
-    AUDDBG("f: mad: audmad_get_song_tuple: %s", string);
+    AUDDBG("f: mad: audmad_get_song_tuple: %s\n", string);
     g_free(string);
     string = NULL;
 #endif
@@ -635,7 +635,7 @@
 
 #ifdef AUD_DEBUG
             if(info.playback)
-                AUDDBG("info.playback->playing = %d",info.playback->playing);
+                AUDDBG("info.playback->playing = %d\n",info.playback->playing);
 #endif
             tmp = aud_vfs_get_metadata(info.infile ? info.infile : fd, "track-name");
             if(tmp){
@@ -660,14 +660,14 @@
                 tmp = NULL;
             }
 
-            AUDDBG("audmad_get_song_tuple: track_name = %s", aud_tuple_get_string(tuple, -1, "track-name"));
-            AUDDBG("audmad_get_song_tuple: stream_name = %s", aud_tuple_get_string(tuple, -1, "stream-name"));
+            AUDDBG("audmad_get_song_tuple: track_name = %s\n", aud_tuple_get_string(tuple, -1, "track-name"));
+            AUDDBG("audmad_get_song_tuple: stream_name = %s\n", aud_tuple_get_string(tuple, -1, "stream-name"));
             aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, -1);
             aud_tuple_associate_int(tuple, FIELD_MTIME, NULL, 0); // this indicates streaming
-            AUDDBG("get_song_tuple: remote: tuple");
+            AUDDBG("get_song_tuple: remote: tuple\n");
             return tuple;
         }
-        AUDDBG("get_song_tuple: remote: NULL");
+        AUDDBG("get_song_tuple: remote: NULL\n");
     } /* info.remote  */
 
     // if !fd, pre-open the file with aud_vfs_fopen() and reuse fd.
@@ -727,7 +727,7 @@
             // genre
             __set_and_free(tuple, FIELD_GENRE, NULL, input_id3_get_string(tag, ID3_FRAME_GENRE));
             __set_and_free(tuple, FIELD_COMMENT, NULL, input_id3_get_string(tag, ID3_FRAME_COMMENT));
-            AUDDBG("genre = %s", aud_tuple_get_string(tuple, FIELD_GENRE, NULL));
+            AUDDBG("genre = %s\n", aud_tuple_get_string(tuple, FIELD_GENRE, NULL));
         }
         id3_file_close(id3file);
     } // id3file
@@ -755,7 +755,7 @@
     if(local_fd)
         aud_vfs_fclose(fd);
 
-    AUDDBG("e: mad: audmad_get_song_tuple");
+    AUDDBG("e: mad: audmad_get_song_tuple\n");
     return tuple;
 }
 
--- a/src/madplug/replaygain.c	Tue Jan 01 22:54:10 2008 +0900
+++ b/src/madplug/replaygain.c	Tue Jan 01 23:12:46 2008 +0900
@@ -203,11 +203,11 @@
 	char *value;
 	struct id3_frame *frame;
 
-	AUDDBG("f: ReadId3v2TXXX");
+	AUDDBG("f: ReadId3v2TXXX\n");
 
 	/* tag must be read before! */
 	if (! file_info->tag ) {
-		AUDDBG("id3v2 not found");
+		AUDDBG("id3v2 not found\n");
 		return 0;
 	}
 
@@ -255,7 +255,7 @@
     VFSFile *fp;
     glong curpos = 0;
 
-    AUDDBG("f: read_replaygain");
+    AUDDBG("f: read_replaygain\n");
 
     file_info->has_replaygain = FALSE;
     file_info->replaygain_album_scale = -1;
@@ -265,10 +265,10 @@
 
     if (ReadId3v2TXXX(file_info)) {
 #ifdef AUD_DEBUG
-        AUDDBG("found ReplayGain info in id3v2 tag");
+        AUDDBG("found ReplayGain info in id3v2 tag\n");
 
 	gchar *tmp = g_filename_to_utf8(file_info->filename, -1, NULL, NULL, NULL);
-        AUDDBG("RG album scale= %g, RG track scale = %g, in %s",
+        AUDDBG("RG album scale= %g, RG track scale = %g, in %s\n",
 		  file_info->replaygain_album_scale,
 		  file_info->replaygain_track_scale, tmp);
         g_free(tmp);
@@ -318,13 +318,13 @@
         }
 #ifdef AUD_DEBUG
         else 
-            AUDDBG("replaygain: not found");
+            AUDDBG("replaygain: not found\n");
 #endif
     }
 #ifdef AUD_DEBUG
     if (res == 0) {             // got APE tags, show the result
         gchar *tmp = g_filename_to_utf8(file_info->filename, -1, NULL, NULL, NULL);        
-        AUDDBG("RG album scale= %g, RG track scale = %g, in %s",
+        AUDDBG("RG album scale= %g, RG track scale = %g, in %s\n",
 		  file_info->replaygain_album_scale,
 		  file_info->replaygain_track_scale, tmp);
         g_free(tmp);
@@ -340,5 +340,5 @@
 
     aud_vfs_fclose(fp);
 
-    AUDDBG("e: read_replaygain");
+    AUDDBG("e: read_replaygain\n");
 }