Mercurial > mplayer.hg
comparison stream/stream_dvb.c @ 21241:6e3fb3e851ac
match exactly card number N specified, rather than the N-th actually usable
author | nicodvb |
---|---|
date | Sun, 26 Nov 2006 12:03:23 +0000 |
parents | 5357da9f0690 |
children | f43100cbeee5 |
comparison
equal
deleted
inserted
replaced
21240:914a7d3df7ac | 21241:6e3fb3e851ac |
---|---|
664 // I don't force the file format bacause, although it's almost always TS, | 664 // I don't force the file format bacause, although it's almost always TS, |
665 // there are some providers that stream an IP multicast with M$ Mpeg4 inside | 665 // there are some providers that stream an IP multicast with M$ Mpeg4 inside |
666 struct stream_priv_s* p = (struct stream_priv_s*)opts; | 666 struct stream_priv_s* p = (struct stream_priv_s*)opts; |
667 dvb_priv_t *priv; | 667 dvb_priv_t *priv; |
668 char *progname; | 668 char *progname; |
669 int tuner_type = 0; | 669 int tuner_type = 0, i; |
670 | 670 |
671 | 671 |
672 if(mode != STREAM_READ) | 672 if(mode != STREAM_READ) |
673 return STREAM_UNSUPORTED; | 673 return STREAM_UNSUPORTED; |
674 | 674 |
686 return STREAM_ERROR; | 686 return STREAM_ERROR; |
687 } | 687 } |
688 dvb_config->priv = priv; | 688 dvb_config->priv = priv; |
689 priv->config = dvb_config; | 689 priv->config = dvb_config; |
690 | 690 |
691 if(p->card < 1 || p->card > priv->config->count) | 691 priv->card = -1; |
692 for(i=0; i<priv->config->count; i++) | |
693 { | |
694 if(priv->config->cards[i].devno+1 == p->card) | |
695 { | |
696 priv->card = i; | |
697 break; | |
698 } | |
699 } | |
700 | |
701 if(priv->card == -1) | |
692 { | 702 { |
693 free(priv); | 703 free(priv); |
694 mp_msg(MSGT_DEMUX, MSGL_ERR, "NO CONFIGURATION FOUND FOR CARD N. %d, exit\n", p->card); | 704 mp_msg(MSGT_DEMUX, MSGL_ERR, "NO CONFIGURATION FOUND FOR CARD N. %d, exit\n", p->card); |
695 return STREAM_ERROR; | 705 return STREAM_ERROR; |
696 } | 706 } |
697 priv->card = p->card - 1; | |
698 priv->timeout = p->timeout; | 707 priv->timeout = p->timeout; |
699 | 708 |
700 tuner_type = priv->config->cards[priv->card].type; | 709 tuner_type = priv->config->cards[priv->card].type; |
701 | 710 |
702 if(tuner_type == 0) | 711 if(tuner_type == 0) |