summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmpdemux/dvbin.c23
-rw-r--r--mplayer.c30
2 files changed, 48 insertions, 5 deletions
diff --git a/libmpdemux/dvbin.c b/libmpdemux/dvbin.c
index fc5dd6c13c..c6437c1b1a 100644
--- a/libmpdemux/dvbin.c
+++ b/libmpdemux/dvbin.c
@@ -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"))
diff --git a/mplayer.c b/mplayer.c
index 1a21a6babd..d661f5a3bc 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -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));