diff options
author | Josh Coalson <jcoalson@users.sourceforce.net> | 2005-09-02 05:00:31 +0000 |
---|---|---|
committer | Josh Coalson <jcoalson@users.sourceforce.net> | 2005-09-02 05:00:31 +0000 |
commit | d2918a3c5e14828443a51939daec193cbed6a23b (patch) | |
tree | bbbd9985e98a0489ab7a1508c51d2a9df2753f0e | |
parent | bdb9b2cb198f8f8dc7c61fb25743a4643d54a83a (diff) | |
download | flac-d2918a3c5e14828443a51939daec193cbed6a23b.tar.gz |
last batch of fixes related to problems caused by new http streaming code
-rw-r--r-- | src/plugin_xmms/configure.c | 17 | ||||
-rw-r--r-- | src/plugin_xmms/plugin.c | 19 |
2 files changed, 24 insertions, 12 deletions
diff --git a/src/plugin_xmms/configure.c b/src/plugin_xmms/configure.c index 7d5bf20b..9e1d77f4 100644 --- a/src/plugin_xmms/configure.c +++ b/src/plugin_xmms/configure.c @@ -55,13 +55,13 @@ flac_config_t flac_cfg = { 100 /* KB */, /* http_buffer_size */ 50, /* http_prebuffer */ FALSE, /* use_proxy */ - "", /* proxy_host */ + NULL, /* proxy_host */ 0, /* proxy_port */ FALSE, /* proxy_use_auth */ - "", /* proxy_user */ - "", /* proxy_pass */ + NULL, /* proxy_user */ + NULL, /* proxy_pass */ FALSE, /* save_http_stream */ - FALSE, /* save_http_path */ + NULL, /* save_http_path */ FALSE, /* cast_title_streaming */ FALSE /* use_udp_channel */ }, @@ -159,7 +159,8 @@ static void flac_configurewin_ok(GtkWidget * widget, gpointer data) flac_cfg.stream.http_prebuffer = (gint) GTK_ADJUSTMENT(streaming_pre_adj)->value; flac_cfg.stream.use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use)); - g_free(flac_cfg.stream.proxy_host); + if(flac_cfg.stream.proxy_host) + g_free(flac_cfg.stream.proxy_host); flac_cfg.stream.proxy_host = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_host_entry))); flac_cfg.stream.proxy_port = atoi(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_port_entry))); @@ -380,7 +381,7 @@ void FLAC_XMMS__configure(void) GtkWidget *streaming_size_box, *streaming_size_label, *streaming_size_spin; GtkWidget *streaming_pre_box, *streaming_pre_label, *streaming_pre_spin; GtkWidget *streaming_proxy_frame, *streaming_proxy_vbox; - GtkWidget *streaming_proxy_port_label, *streaming_proxy_host_label; + GtkWidget *streaming_proxy_port_label, *streaming_proxy_host_label; GtkWidget *streaming_save_frame, *streaming_save_vbox; GtkWidget *streaming_save_label, *streaming_save_browse; #ifdef FLAC_ICECAST @@ -666,7 +667,7 @@ void FLAC_XMMS__configure(void) gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_label, FALSE, FALSE, 0); streaming_proxy_host_entry = gtk_entry_new(); - gtk_entry_set_text(GTK_ENTRY(streaming_proxy_host_entry), flac_cfg.stream.proxy_host); + gtk_entry_set_text(GTK_ENTRY(streaming_proxy_host_entry), flac_cfg.stream.proxy_host? flac_cfg.stream.proxy_host : ""); gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_entry, TRUE, TRUE, 0); streaming_proxy_port_label = gtk_label_new(_("Port:")); @@ -731,7 +732,7 @@ void FLAC_XMMS__configure(void) gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label, FALSE, FALSE, 0); streaming_save_entry = gtk_entry_new(); - gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), flac_cfg.stream.save_http_path); + gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), flac_cfg.stream.save_http_path? flac_cfg.stream.save_http_path : ""); gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry, TRUE, TRUE, 0); streaming_save_browse = gtk_button_new_with_label(_("Browse")); diff --git a/src/plugin_xmms/plugin.c b/src/plugin_xmms/plugin.c index 343038ec..c0948ce5 100644 --- a/src/plugin_xmms/plugin.c +++ b/src/plugin_xmms/plugin.c @@ -220,7 +220,8 @@ void FLAC_XMMS__init() is_big_endian_host_ = (*((FLAC__byte*)(&test)))? false : true; flac_cfg.title.tag_override = FALSE; - g_free(flac_cfg.title.tag_format); + if (flac_cfg.title.tag_format) + g_free(flac_cfg.title.tag_format); flac_cfg.title.convert_char_set = FALSE; cfg = xmms_cfg_open_default_file(); @@ -262,14 +263,24 @@ void FLAC_XMMS__init() xmms_cfg_read_int(cfg, "flac", "stream.http_buffer_size", &flac_cfg.stream.http_buffer_size); xmms_cfg_read_int(cfg, "flac", "stream.http_prebuffer", &flac_cfg.stream.http_prebuffer); xmms_cfg_read_boolean(cfg, "flac", "stream.use_proxy", &flac_cfg.stream.use_proxy); - xmms_cfg_read_string(cfg, "flac", "stream.proxy_host", &flac_cfg.stream.proxy_host); + if(flac_cfg.stream.proxy_host) + g_free(flac_cfg.stream.proxy_host); + if(!xmms_cfg_read_string(cfg, "flac", "stream.proxy_host", &flac_cfg.stream.proxy_host)) + flac_cfg.stream.proxy_host = g_strdup(""); xmms_cfg_read_int(cfg, "flac", "stream.proxy_port", &flac_cfg.stream.proxy_port); xmms_cfg_read_boolean(cfg, "flac", "stream.proxy_use_auth", &flac_cfg.stream.proxy_use_auth); + if(flac_cfg.stream.proxy_user) + g_free(flac_cfg.stream.proxy_user); + flac_cfg.stream.proxy_user = NULL; xmms_cfg_read_string(cfg, "flac", "stream.proxy_user", &flac_cfg.stream.proxy_user); + if(flac_cfg.stream.proxy_pass) + g_free(flac_cfg.stream.proxy_pass); + flac_cfg.stream.proxy_pass = NULL; xmms_cfg_read_string(cfg, "flac", "stream.proxy_pass", &flac_cfg.stream.proxy_pass); xmms_cfg_read_boolean(cfg, "flac", "stream.save_http_stream", &flac_cfg.stream.save_http_stream); - if (!xmms_cfg_read_string(cfg, "flac", "stream.save_http_path", &flac_cfg.stream.save_http_path) || - ! *flac_cfg.stream.save_http_path) { + if (flac_cfg.stream.save_http_path) + g_free (flac_cfg.stream.save_http_path); + if (!xmms_cfg_read_string(cfg, "flac", "stream.save_http_path", &flac_cfg.stream.save_http_path) || ! *flac_cfg.stream.save_http_path) { if (flac_cfg.stream.save_http_path) g_free (flac_cfg.stream.save_http_path); flac_cfg.stream.save_http_path = homedir(); |