summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--config.c8
-rw-r--r--config.h3
-rw-r--r--frontend_local.c4
-rw-r--r--xine_fbfe_frontend.c10
-rw-r--r--xine_frontend.c9
-rw-r--r--xine_frontend.h5
-rw-r--r--xine_frontend_main.c21
8 files changed, 44 insertions, 17 deletions
diff --git a/HISTORY b/HISTORY
index db69cf22..b87257ce 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3,6 +3,7 @@ VDR Plugin 'xineliboutput' Revision History
????-??-??: Version 1.1.0
+- Added '-C'/'--config' command-line option to specify xine's configuration file.
- Replaced cIConv with VDR's cCharConv.
- Supports only for vdr-1.6.0 or later.
- Added an option to limit number of remote clients
diff --git a/config.c b/config.c
index 2816f605..f60ba69f 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.75 2008-11-20 11:46:30 rofafor Exp $
+ * $Id: config.c,v 1.76 2008-12-19 16:01:54 rofafor Exp $
*
*/
@@ -462,6 +462,7 @@ config_t::config_t() {
speaker_type = SPEAKERS_STEREO;
post_plugins = NULL;
+ config_file = NULL;
audio_delay = 0;
audio_compression = 0;
@@ -606,7 +607,7 @@ bool config_t::ProcessArg(const char *Name, const char *Value)
bool config_t::ProcessArgs(int argc, char *argv[])
{
- static const char short_options[] = "fDw:h:l:r:A:V:d:P:pc";
+ static const char short_options[] = "fDw:h:l:r:A:V:d:P:C:pc";
static const struct option long_options[] = {
{ "fullscreen", no_argument, NULL, 'f' },
@@ -622,6 +623,7 @@ bool config_t::ProcessArgs(int argc, char *argv[])
{ "video", required_argument, NULL, 'V' },
{ "display", required_argument, NULL, 'd' },
{ "post", required_argument, NULL, 'P' },
+ { "config", required_argument, NULL, 'C' },
{ "primary", no_argument, NULL, 'p' },
{ "exit-on-close",no_argument, NULL, 'c' },
{ NULL }
@@ -686,6 +688,8 @@ bool config_t::ProcessArgs(int argc, char *argv[])
post_plugins = strcatrealloc(post_plugins, ";");
post_plugins = strcatrealloc(post_plugins, optarg);
break;
+ case 'C': config_file = strdup(optarg);
+ break;
case 'p': ProcessArg("ForcePrimaryDevice", "1");
break;
case 'c': exit_on_close = 1;
diff --git a/config.h b/config.h
index 34400e1e..dd2c3fdb 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.57 2008-11-20 11:46:30 rofafor Exp $
+ * $Id: config.h,v 1.58 2008-12-19 16:01:55 rofafor Exp $
*
*/
@@ -244,6 +244,7 @@ class config_t {
char audio_driver[32];
char audio_port[64];
char *post_plugins; // static post plugins from command line options
+ char *config_file; // config file from command line options
int pes_buffers;
char modeline[64];
diff --git a/frontend_local.c b/frontend_local.c
index 05d36192..60baa53f 100644
--- a/frontend_local.c
+++ b/frontend_local.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_local.c,v 1.34 2008-11-20 11:46:31 rofafor Exp $
+ * $Id: frontend_local.c,v 1.35 2008-12-19 16:01:55 rofafor Exp $
*
*/
@@ -365,7 +365,7 @@ void cXinelibLocal::Action(void)
if(!fe->xine_init(fe, xc.audio_driver, xc.audio_port,
xc.video_driver,
xc.pes_buffers,
- xc.post_plugins)) {
+ xc.post_plugins, xc.config_file)) {
LOGMSG("cXinelibLocal: Error initializing frontend");
break;
}
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c
index 9f954fb8..beb4d885 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.42 2008-11-17 23:39:20 phintuka Exp $
+ * $Id: xine_fbfe_frontend.c,v 1.43 2008-12-19 16:01:55 rofafor Exp $
*
*/
@@ -40,7 +40,8 @@ typedef struct fbfe_s {
const char *audio_port,
const char *video_driver,
int pes_buffers,
- const char *static_post_plugins);
+ const char *static_post_plugins,
+ const char *config_file);
/* display */
/*char *modeline;*/
@@ -267,7 +268,8 @@ static int fbfe_xine_init(frontend_t *this_gen, const char *audio_driver,
const char *audio_port,
const char *video_driver,
int pes_buffers,
- const char *static_post_plugins)
+ const char *static_post_plugins,
+ const char *config_file)
{
fbfe_t *this = (fbfe_t*)this_gen;
@@ -275,7 +277,7 @@ static int fbfe_xine_init(frontend_t *this_gen, const char *audio_driver,
update_DFBARGS(this->x.video_port_name);
return this->fe_xine_init(this_gen, audio_driver, audio_port,
- video_driver, pes_buffers, static_post_plugins);
+ video_driver, pes_buffers, static_post_plugins, config_file);
}
static frontend_t *fbfe_get_frontend(void)
diff --git a/xine_frontend.c b/xine_frontend.c
index 482d4566..acdd0d7f 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.92 2008-12-18 14:12:43 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.93 2008-12-19 16:01:55 rofafor Exp $
*
*/
@@ -530,7 +530,8 @@ static int fe_xine_init(frontend_t *this_gen, const char *audio_driver,
const char *audio_port,
const char *video_driver,
int pes_buffers,
- const char *static_post_plugins)
+ const char *static_post_plugins,
+ const char *config_file)
{
fe_t *this = (fe_t*)this_gen;
post_plugins_t *posts = NULL;
@@ -569,7 +570,9 @@ static int fe_xine_init(frontend_t *this_gen, const char *audio_driver,
free(this->configfile);
this->configfile = NULL;
- if(asprintf(&this->configfile, "%s%s", xine_get_homedir(),
+ if (config_file)
+ this->configfile = strdup(config_file);
+ else if(asprintf(&this->configfile, "%s%s", xine_get_homedir(),
"/.xine/config_xineliboutput") < 0)
return 0;
diff --git a/xine_frontend.h b/xine_frontend.h
index b8523dda..e124ac36 100644
--- a/xine_frontend.h
+++ b/xine_frontend.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.h,v 1.16 2008-12-13 23:59:05 phintuka Exp $
+ * $Id: xine_frontend.h,v 1.17 2008-12-19 16:01:55 rofafor Exp $
*
*/
@@ -79,7 +79,8 @@ struct frontend_s {
const char *audio_port,
const char *video_driver,
int pes_buffers,
- const char *static_post);
+ const char *static_post,
+ const char *config_file);
int (*xine_open)(frontend_t*, const char *mrl);
int (*xine_play)(frontend_t*);
int (*xine_stop)(frontend_t*);
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index 7436fd6d..dcebaf4e 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_main.c,v 1.70 2008-12-14 00:11:53 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.71 2008-12-19 16:01:55 rofafor Exp $
*
*/
@@ -396,6 +396,7 @@ static const char help_str[] =
" --post=upmix;tvtime:enabled=1,cheap_mode=1\n"
" --lirc[=devicename] Use lirc input device\n"
" Optional lirc socket name can be given\n"
+ " --config=file Use config file (default: ~/.xine/config_xineliboutput).\n"
" --verbose Verbose debug output\n"
" --silent Silent mode (report only errors)\n"
" --syslog Write all output to system log\n"
@@ -412,7 +413,7 @@ static const char help_str[] =
" are tried in following order:\n"
" local pipe, rtp, udp, tcp\n\n";
-static const char short_options[] = "HL:A:V:d:a:fDw:h:P:vslkobtur";
+static const char short_options[] = "HA:V:d:a:fDw:h:P:L:C:vslkobtur";
static const struct option long_options[] = {
{ "help", no_argument, NULL, 'H' },
@@ -428,6 +429,7 @@ static const struct option long_options[] = {
{ "noscaling", no_argument, NULL, 'n' },
{ "post", required_argument, NULL, 'P' },
{ "lirc", optional_argument, NULL, 'L' },
+ { "config", required_argument, NULL, 'C' },
{ "verbose", no_argument, NULL, 'v' },
{ "silent", no_argument, NULL, 's' },
@@ -465,6 +467,7 @@ int main(int argc, char *argv[])
char *aspect_controller = NULL;
int repeat_emu = 0;
char *exec_name = argv[0];
+ char *config_file = NULL;
LogToSysLog = 0;
@@ -551,6 +554,9 @@ int main(int argc, char *argv[])
static_post_plugins = strcatrealloc(static_post_plugins, optarg);
PRINTF("Post plugins: %s\n", static_post_plugins);
break;
+ case 'C': config_file = strdup(optarg);
+ PRINTF("Config file: %s\n", config_file);
+ break;
case 'L': lirc_dev = optarg ? : strdup("/dev/lircd");
if (strstr((char*)lirc_dev, ",repeatemu")) {
*strstr((char*)lirc_dev, ",repeatemu") = 0;
@@ -700,7 +706,7 @@ int main(int argc, char *argv[])
}
/* Initialize xine */
- if (!fe->xine_init(fe, adrv, adev, gdrv, 250, static_post_plugins)) {
+ if (!fe->xine_init(fe, adrv, adev, gdrv, 250, static_post_plugins, config_file)) {
fprintf(stderr, "Error initializing xine\n");
list_xine_plugins(fe, SysLogLevel>2);
fe->fe_free(fe);
@@ -790,5 +796,14 @@ int main(int argc, char *argv[])
fe->fe_free(fe);
+ if (config_file) free(config_file);
+ if (static_post_plugins) free(static_post_plugins);
+ if (mrl) free(mrl);
+ if (adrv) free(adrv);
+ if (gdrv) free(gdrv);
+ if (video_port) free(video_port);
+ if (aspect_controller) free(aspect_controller);
+ if (lirc_dev) free(lirc_dev);
+
return xine_finished==FE_XINE_EXIT ? 0 : 1;
}