summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-06 20:27:32 +0200
committerwm4 <wm4@nowhere>2014-08-06 20:30:48 +0200
commit3234f5a123f5809a8ad3dc3d5ca7488739c0d73f (patch)
tree624a2a9309be229077df8858e1a909e6f797a196
parent796db6617430294c3aefdf978010a074d5f912e7 (diff)
downloadmpv-3234f5a123f5809a8ad3dc3d5ca7488739c0d73f.tar.bz2
mpv-3234f5a123f5809a8ad3dc3d5ca7488739c0d73f.tar.xz
stream_dvb: restore --dvbin-file option
Got lost some time ago. Although I'm not sure if it actually does anything on MPlayer (it exists there, but might broken, not sure). Fixes #988 (untested).
-rw-r--r--stream/dvbin.h1
-rw-r--r--stream/stream_dvb.c21
2 files changed, 15 insertions, 7 deletions
diff --git a/stream/dvbin.h b/stream/dvbin.h
index 1eb7174af0..e225e38383 100644
--- a/stream/dvbin.h
+++ b/stream/dvbin.h
@@ -95,6 +95,7 @@ typedef struct dvb_params {
char *cfg_prog;
int cfg_card;
int cfg_timeout;
+ char *cfg_file;
} dvb_priv_t;
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index 8695782b7d..573a9234df 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -77,6 +77,7 @@ const struct m_sub_options stream_dvb_conf = {
OPT_STRING("prog", cfg_prog, 0),
OPT_INTRANGE("card", cfg_card, 0, 1, 4),
OPT_INTRANGE("timeout", cfg_timeout, 0, 1, 30),
+ OPT_STRING("file", cfg_file, 0),
{0}
},
.size = sizeof(struct dvb_params),
@@ -717,8 +718,9 @@ dvb_config_t *dvb_get_config(stream_t *stream)
{
struct mp_log *log = stream->log;
struct mpv_global *global = stream->global;
+ dvb_priv_t *priv = stream->priv;
int i, fd, type, size;
- char filename[30], *conf_file, *name;
+ char filename[30], *name;
dvb_channels_list *list;
dvb_card_config_t *cards = NULL, *tmp;
dvb_config_t *conf = NULL;
@@ -750,7 +752,11 @@ dvb_config_t *dvb_get_config(stream_t *stream)
}
void *talloc_ctx = talloc_new(NULL);
- switch(type) {
+ char *conf_file = NULL;
+ if (priv->cfg_file && priv->cfg_file[0]) {
+ conf_file = priv->cfg_file;
+ } else {
+ switch(type) {
case TUNER_TER:
conf_file = mp_find_config_file(talloc_ctx, global, "channels.conf.ter");
break;
@@ -763,11 +769,12 @@ dvb_config_t *dvb_get_config(stream_t *stream)
case TUNER_ATSC:
conf_file = mp_find_config_file(talloc_ctx, global, "channels.conf.atsc");
break;
- }
- if (conf_file) {
- mp_verbose(log, "Ignoring other channels.conf files.\n");
- } else {
- conf_file = mp_find_config_file(talloc_ctx, global, "channels.conf");
+ }
+ if (conf_file) {
+ mp_verbose(log, "Ignoring other channels.conf files.\n");
+ } else {
+ conf_file = mp_find_config_file(talloc_ctx, global, "channels.conf");
+ }
}
list = dvb_get_channels(log, conf_file, type);