mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
nonsense removal: compare old and new frequency in order to skip tuning
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20675 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
28c55c4103
commit
ac9b9fcd19
@ -100,9 +100,9 @@ typedef struct {
|
||||
int tuner_type;
|
||||
int is_on;
|
||||
stream_t *stream;
|
||||
char new_tuning[256], prev_tuning[256];
|
||||
int retry;
|
||||
int timeout;
|
||||
int last_freq;
|
||||
} dvb_priv_t;
|
||||
|
||||
|
||||
|
@ -458,7 +458,6 @@ int dvb_set_channel(dvb_priv_t *priv, int card, int n)
|
||||
{
|
||||
dvb_channels_list *new_list;
|
||||
dvb_channel_t *channel;
|
||||
int do_tuning;
|
||||
stream_t *stream = (stream_t*) priv->stream;
|
||||
char buf[4096];
|
||||
dvb_config_t *conf = (dvb_config_t *) priv->config;
|
||||
@ -495,7 +494,6 @@ int dvb_set_channel(dvb_priv_t *priv, int card, int n)
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "DVB_SET_CHANNEL, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
|
||||
return 0;
|
||||
}
|
||||
strcpy(priv->prev_tuning, "");
|
||||
}
|
||||
else //close all demux_fds with pos > pids required for the new channel or open other demux_fds if we have too few
|
||||
{
|
||||
@ -510,7 +508,6 @@ int dvb_set_channel(dvb_priv_t *priv, int card, int n)
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "DVB_SET_CHANNEL2, COULDN'T OPEN DEVICES OF CARD: %d, EXIT\n", card);
|
||||
return 0;
|
||||
}
|
||||
strcpy(priv->prev_tuning, "");
|
||||
}
|
||||
|
||||
dvb_config->priv = priv;
|
||||
@ -521,52 +518,16 @@ int dvb_set_channel(dvb_priv_t *priv, int card, int n)
|
||||
stream->fd = priv->dvr_fd;
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "DVB_SET_CHANNEL: new channel name=%s, card: %d, channel %d\n", channel->name, card, n);
|
||||
|
||||
switch(priv->tuner_type)
|
||||
{
|
||||
case TUNER_SAT:
|
||||
sprintf(priv->new_tuning, "%d|%09d|%09d|%d|%c", priv->card, channel->freq, channel->srate, channel->diseqc, channel->pol);
|
||||
break;
|
||||
|
||||
case TUNER_TER:
|
||||
sprintf(priv->new_tuning, "%d|%09d|%d|%d|%d|%d|%d|%d", priv->card, channel->freq, channel->inv,
|
||||
channel->bw, channel->cr, channel->mod, channel->trans, channel->gi);
|
||||
break;
|
||||
|
||||
case TUNER_CBL:
|
||||
sprintf(priv->new_tuning, "%d|%09d|%d|%d|%d|%d", priv->card, channel->freq, channel->inv, channel->srate,
|
||||
channel->cr, channel->mod);
|
||||
break;
|
||||
#ifdef DVB_ATSC
|
||||
case TUNER_ATSC:
|
||||
sprintf(priv->new_tuning, "%d|%09d|%d", priv->card, channel->freq, channel->mod);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(strcmp(priv->prev_tuning, priv->new_tuning))
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "DIFFERENT TUNING THAN THE PREVIOUS: %s -> %s\n", priv->prev_tuning, priv->new_tuning);
|
||||
strcpy(priv->prev_tuning, priv->new_tuning);
|
||||
do_tuning = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SAME TUNING PARAMETERS, NO TUNING\n");
|
||||
do_tuning = 0;
|
||||
}
|
||||
|
||||
stream->eof=1;
|
||||
stream_reset(stream);
|
||||
|
||||
|
||||
if(do_tuning)
|
||||
if(channel->freq != priv->last_freq)
|
||||
if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone,
|
||||
channel->inv, channel->mod, channel->gi, channel->trans, channel->bw, channel->cr, channel->cr_lp, channel->hier, priv->timeout))
|
||||
return 0;
|
||||
|
||||
|
||||
priv->last_freq = channel->freq;
|
||||
priv->is_on = 1;
|
||||
|
||||
//sets demux filters and restart the stream
|
||||
@ -666,7 +627,6 @@ static int dvb_streaming_start(dvb_priv_t *priv, struct stream_priv_s *opts, int
|
||||
}
|
||||
|
||||
|
||||
strcpy(priv->prev_tuning, "");
|
||||
if(!dvb_set_channel(priv, priv->card, priv->list->current))
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR, COULDN'T SET CHANNEL %i: ", priv->list->current);
|
||||
|
Loading…
Reference in New Issue
Block a user