summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Lampard <mlampard@users.sourceforge.net>2004-11-25 06:56:51 +0000
committerMike Lampard <mlampard@users.sourceforge.net>2004-11-25 06:56:51 +0000
commiteb9c772ce2696979d1f9cbc5371e2b358577bef4 (patch)
treee16febaa1e3799998eb3df5a147cbdb56c159d9b
parentb1f794babbe223ac5bc8c0b35220d61f5ea84bda (diff)
downloadxine-lib-eb9c772ce2696979d1f9cbc5371e2b358577bef4.tar.gz
xine-lib-eb9c772ce2696979d1f9cbc5371e2b358577bef4.tar.bz2
fix bug whereby channelname MRLs preceded by a number aren't recognised.
move registration of adapternum config item to class init CVS patchset: 7163 CVS date: 2004/11/25 06:56:51
-rw-r--r--src/input/input_dvb.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 3ca6229e2..55389dbc4 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -1883,19 +1883,11 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
char str[256];
char *ptr;
int x;
+ char dummy;
xine_cfg_entry_t zoomdvb;
config_values_t *config = this->stream->xine->config;
xine_cfg_entry_t lastchannel;
xine_cfg_entry_t adapter;
-
- config->register_num(config, "input.dvb_adapternum",
- 0,
- _("Number of dvb card to use."),
- _("Leave this at zero unless you "
- "really have more than 1 card "
- "in your system."),
- 0, NULL, (void *) this);
-
xine_config_lookup_entry(this->stream->xine, "input.dvb_adapternum", &adapter);
if (!(tuner = tuner_init(this->class->xine,adapter.num_value))) {
@@ -1918,7 +1910,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
return 0;
}
- if (sscanf(this->mrl, "dvb://%d", &this->channel) == 1)
+ if ((sscanf(this->mrl, "dvb://%d%1c", &this->channel, &dummy) >0 ) && ((isalpha(dummy)==0) && (isspace(dummy)==0)))
{
/* dvb://<number> format: load channels from ~/.xine/channels.conf */
if (this->channel >= num_channels) {
@@ -2380,6 +2372,14 @@ static void *init_class (xine_t *xine, void *data) {
"switch to this channel. "),
11, NULL, NULL);
+ config->register_num(config, "input.dvb_adapternum",
+ 0,
+ _("Number of dvb card to use."),
+ _("Leave this at zero unless you "
+ "really have more than 1 card "
+ "in your system."),
+ 0, NULL, (void *) this);
+
return this;
}