summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvb.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-26 12:03:23 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-26 12:03:23 +0000
commit30155960a4d4799743e59e89724dcc6550ff5229 (patch)
tree0beab109367d81621b2c7041ac0bf5f5723f3683 /stream/stream_dvb.c
parent0fe6e9fbd25acb09c646b5190980c5dfcaae17f2 (diff)
downloadmpv-30155960a4d4799743e59e89724dcc6550ff5229.tar.bz2
mpv-30155960a4d4799743e59e89724dcc6550ff5229.tar.xz
match exactly card number N specified, rather than the N-th actually usable
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21257 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream_dvb.c')
-rw-r--r--stream/stream_dvb.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index b62024b0ba..a5fc6b0683 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -666,7 +666,7 @@ static int dvb_open(stream_t *stream, int mode, void *opts, int *file_format)
struct stream_priv_s* p = (struct stream_priv_s*)opts;
dvb_priv_t *priv;
char *progname;
- int tuner_type = 0;
+ int tuner_type = 0, i;
if(mode != STREAM_READ)
@@ -688,13 +688,22 @@ static int dvb_open(stream_t *stream, int mode, void *opts, int *file_format)
dvb_config->priv = priv;
priv->config = dvb_config;
- if(p->card < 1 || p->card > priv->config->count)
+ priv->card = -1;
+ for(i=0; i<priv->config->count; i++)
+ {
+ if(priv->config->cards[i].devno+1 == p->card)
+ {
+ priv->card = i;
+ break;
+ }
+ }
+
+ if(priv->card == -1)
{
free(priv);
mp_msg(MSGT_DEMUX, MSGL_ERR, "NO CONFIGURATION FOUND FOR CARD N. %d, exit\n", p->card);
return STREAM_ERROR;
}
- priv->card = p->card - 1;
priv->timeout = p->timeout;
tuner_type = priv->config->cards[priv->card].type;