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 */
},
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)));
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
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:"));
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"));
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();
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();