diff src/flac112/plugin.c @ 492:0dd1ff7e5ba7 trunk

[svn] flac 112 plugin: stability fixes and a new option to disable bitrate update in player window during playback (saves cpu, this is the solution for most people playing flac and reporting high cpu usage)
author giacomo
date Sun, 21 Jan 2007 16:03:30 -0800
parents be4cde738a73
children 5f2145032f46
line wrap: on
line diff
--- a/src/flac112/plugin.c	Sun Jan 21 15:34:56 2007 -0800
+++ b/src/flac112/plugin.c	Sun Jan 21 16:03:30 2007 -0800
@@ -239,6 +239,8 @@
 
 	bmp_cfg_db_get_bool(db, "flac", "title.tag_override", &flac_cfg.title.tag_override);
 
+	bmp_cfg_db_get_bool(db, "flac", "title.disable_bitrate_update", &flac_cfg.title.disable_bitrate_update);
+
 	if(!bmp_cfg_db_get_string(db, "flac", "title.tag_format", &flac_cfg.title.tag_format))
 		flac_cfg.title.tag_format = g_strdup("%p - %t");
 
@@ -447,28 +449,28 @@
     flac_ip.description = NULL;
 
     if (flac_cfg.title.tag_format) {
-        free(flac_cfg.title.tag_format);
+        g_free(flac_cfg.title.tag_format);
         flac_cfg.title.tag_format = NULL;
     }
 
     if (flac_cfg.title.user_char_set) {
-        free(flac_cfg.title.user_char_set);
+        g_free(flac_cfg.title.user_char_set);
         flac_cfg.title.user_char_set = NULL;
     }
 
     if (flac_cfg.stream.proxy_host) {
-        free(flac_cfg.stream.proxy_host);
+        g_free(flac_cfg.stream.proxy_host);
         flac_cfg.stream.proxy_host = NULL;
     }
 
     if (flac_cfg.stream.proxy_user) {
-        free(flac_cfg.stream.proxy_user);
+        g_free(flac_cfg.stream.proxy_user);
         flac_cfg.stream.proxy_user = NULL;
 
     }
 
     if (flac_cfg.stream.proxy_pass) {
-        free(flac_cfg.stream.proxy_pass);
+        g_free(flac_cfg.stream.proxy_pass);
         flac_cfg.stream.proxy_pass = NULL;
     }
 
@@ -587,7 +589,8 @@
 				sample_buffer_first_ = sample_buffer_last_ = 0;
 			}
 		}
-		else {
+		else if ( !flac_cfg.title.disable_bitrate_update )
+		{
 			/* display the right bitrate from history */
 			unsigned bh_index_o = flac_ip.output->output_time() / BITRATE_HIST_SEGMENT_MSEC % BITRATE_HIST_SIZE;
 			if(bh_index_o != bh_index_last_o && bh_index_o != bh_index_last_w && bh_index_o != (bh_index_last_w + 1) % BITRATE_HIST_SIZE) {