summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2008-06-16 11:36:49 +0000
committerphintuka <phintuka>2008-06-16 11:36:49 +0000
commitb892e6859ebab8ed54f8a1fb179341382e29c859 (patch)
tree0b6c4fb19883c815f2a67ad7ee87970fe96266be
parent4ce6cfe7f149076dcc78d94a78f4bbcb80241d43 (diff)
downloadxineliboutput-b892e6859ebab8ed54f8a1fb179341382e29c859.tar.gz
xineliboutput-b892e6859ebab8ed54f8a1fb179341382e29c859.tar.bz2
Dynamically allocate configfile
-rw-r--r--xine_fbfe_frontend.c4
-rw-r--r--xine_frontend.c15
-rw-r--r--xine_sxfe_frontend.c4
3 files changed, 14 insertions, 9 deletions
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c
index cc666b4b..e238ab11 100644
--- a/xine_fbfe_frontend.c
+++ b/xine_fbfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_fbfe_frontend.c,v 1.22 2008-06-16 11:29:45 phintuka Exp $
+ * $Id: xine_fbfe_frontend.c,v 1.23 2008-06-16 11:36:49 phintuka Exp $
*
*/
@@ -109,7 +109,7 @@ typedef struct fbfe_t {
uint8_t field_order;
/* strings */
- char configfile[256];
+ char *configfile;
char modeline[256];
} fbfe_t, fe_t;
diff --git a/xine_frontend.c b/xine_frontend.c
index ee6bf11c..69387cf2 100644
--- a/xine_frontend.c
+++ b/xine_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.c,v 1.59 2008-06-14 07:13:32 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.60 2008-06-16 11:36:49 phintuka Exp $
*
*/
@@ -502,11 +502,11 @@ static int fe_xine_init(frontend_t *this_gen, const char *audio_driver,
/*xine_register_log_cb(this->xine, xine_log_cb, this);*/
- /* TODO: use different config file ? (vdr conf.dir/xine/config_vdr ?) */
- snprintf(this->configfile, sizeof(this->configfile),
+ free(this->configfile);
+ this->configfile = NULL;
+ asprintf(&this->configfile,
"%s%s", xine_get_homedir(),
"/.xine/config_xineliboutput");
- this->configfile[sizeof(this->configfile)-1] = 0;
xine_config_load (this->xine, this->configfile);
x_reg_num ("engine.buffers.video_num_buffers",
@@ -1091,7 +1091,11 @@ static void fe_xine_exit(frontend_t *this_gen)
fe_xine_close(this_gen);
fe_post_unload(this);
- xine_config_save (this->xine, this->configfile);
+ if(this->configfile) {
+ xine_config_save (this->xine, this->configfile);
+ free(this->configfile);
+ this->configfile = NULL;
+ }
if(this->event_queue)
xine_event_dispose_queue(this->event_queue);
this->event_queue = NULL;
@@ -1133,6 +1137,7 @@ static void fe_free(frontend_t *this_gen)
if (this_gen) {
fe_t *this = (fe_t*)this_gen;
this->fe.fe_display_close(this_gen);
+ free(this->configfile);
free(this);
}
}
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index 5b369cf9..ab0d4c5c 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_sxfe_frontend.c,v 1.59 2008-06-14 04:48:34 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.60 2008-06-16 11:36:49 phintuka Exp $
*
*/
@@ -193,7 +193,7 @@ typedef struct sxfe_s {
uint8_t dragging;
/* strings */
- char configfile[256];
+ char *configfile;
char modeline[256];
/* HUD stuff */