1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-31 12:11:52 +00:00

This patch fixes:

1) if channels (in the list) are invalid excludes them
2) on encrypted/unreadable channels mplayer goes to the next/previous
3) when changing channel uninit all components but stream and input.

Nico <nsabbi@libero.it>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10709 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2003-08-27 17:08:58 +00:00
parent 9bbeb0f652
commit 78c69838c0
2 changed files with 48 additions and 5 deletions

View File

@ -156,9 +156,10 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
row_count = 0;
while(! feof(f) && row_count < 512)
{
if( fgets(line, CHANNEL_LINE_LEN, f) == NULL ) continue;
if( fgets(line, CHANNEL_LINE_LEN, f) == NULL )
continue;
if(line[0] == '#')
if((line[0] == '#') || (strlen(line) == 0))
continue;
ptr = &(list->channels[list->NUM_CHANNELS]);
@ -168,12 +169,22 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
fields = sscanf(line, ter_conf,
&ptr->name, &ptr->freq, &inv, &bw, &cr, &tmp_lcr, &mod,
&transm, &gi, &tmp_hier, &ptr->vpid, &ptr->apid1);
/*
mp_msg(MSGT_DEMUX, MSGL_V,
"NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, VPID: %d, APID1: %d\n",
list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->vpid, ptr->apid1);
*/
}
else if(type == TUNER_CBL)
{
fields = sscanf(line, cbl_conf,
&ptr->name, &ptr->freq, &inv, &ptr->srate,
&cr, &mod, &ptr->vpid, &ptr->apid1);
/*
mp_msg(MSGT_DEMUX, MSGL_V,
"NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, VPID: %d, APID1: %d\n",
list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->vpid, ptr->apid1);
*/
}
else //SATELLITE
{
@ -185,11 +196,15 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
ptr->srate *= 1000UL;
ptr->tone = -1;
mp_msg(MSGT_DEMUX, MSGL_V,
"NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d, TONE: %d, VPID: %d, APID1: %d, APID2: %d, TPID: %d, PROGID: %d, NUM: %d\n",
fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc, ptr->tone, ptr->vpid, ptr->apid1, ptr->apid2, ptr->tpid, ptr->progid, list->NUM_CHANNELS);
"NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d, TONE: %d, VPID: %d, APID1: %d, APID2: %d, TPID: %d, PROGID: %d\n",
list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc, ptr->tone, ptr->vpid, ptr->apid1, ptr->apid2, ptr->tpid, ptr->progid);
}
if(((ptr->vpid <= 0) && (ptr->apid1 <=0)) || (ptr->freq == 0))
continue;
if((type == TUNER_TER) || (type == TUNER_CBL))
{
if(! strcmp(inv, "INVERSION_ON"))

View File

@ -100,6 +100,7 @@ static int quiet=0;
#ifdef HAS_DVBIN_SUPPORT
#include "libmpdemux/dvbin.h"
static int last_dvb_step = 1;
#endif
@ -1532,6 +1533,27 @@ fflush(stdout);
if(!sh_video && !sh_audio){
mp_msg(MSGT_CPLAYER,MSGL_FATAL, MSGTR_NoStreamFound);
#ifdef HAS_DVBIN_SUPPORT
if((stream->type == STREAMTYPE_DVB) && stream->priv)
{
dvb_priv_t *priv = (dvb_priv_t*) stream->priv;
if(priv->is_on)
{
int dir;
int v = last_dvb_step;
if(v > 0)
dir = DVB_CHANNEL_HIGHER;
else
dir = DVB_CHANNEL_LOWER;
if(dvb_step_channel(priv, dir))
{
uninit_player(INITED_ALL-(INITED_STREAM|INITED_INPUT));
goto goto_open_demuxer;
}
}
}
#endif
goto goto_next_file; // exit_player(MSGTR_Exit_error);
}
@ -2868,7 +2890,8 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
{
int dir;
int v = cmd->args[0].v.i;
last_dvb_step = v;
if(v > 0)
dir = DVB_CHANNEL_HIGHER;
else
@ -2904,6 +2927,11 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
dvb_priv_t *priv = (dvb_priv_t*) stream->priv;
if(priv->is_on)
{
if(priv->list->current <= cmd->args[0].v.i)
last_dvb_step = 1;
else
last_dvb_step = -1;
if(dvb_set_channel(priv, cmd->args[0].v.i))
{
uninit_player(INITED_ALL-(INITED_STREAM|INITED_INPUT));