summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--command.c19
-rw-r--r--mplayer.c8
-rw-r--r--stream/dvbin.h4
-rw-r--r--stream/stream_dvb.c11
4 files changed, 14 insertions, 28 deletions
diff --git a/command.c b/command.c
index 65afcb5cbe..68b30b9503 100644
--- a/command.c
+++ b/command.c
@@ -2628,10 +2628,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
#endif /* HAVE_PVR */
}
#ifdef HAS_DVBIN_SUPPORT
- if ((mpctx->stream->type == STREAMTYPE_DVB)
- && mpctx->stream->priv) {
- dvb_priv_t *priv = (dvb_priv_t *) mpctx->stream->priv;
- if (priv->is_on) {
+ if (mpctx->stream->type == STREAMTYPE_DVB) {
int dir;
int v = cmd->args[0].v.i;
@@ -2642,9 +2639,8 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
dir = DVB_CHANNEL_LOWER;
- if (dvb_step_channel(priv, dir))
+ if (dvb_step_channel(mpctx->stream, dir))
mpctx->eof = mpctx->dvbin_reopen = 1;
- }
}
#endif /* HAS_DVBIN_SUPPORT */
break;
@@ -2671,19 +2667,12 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd)
#ifdef HAS_DVBIN_SUPPORT
case MP_CMD_DVB_SET_CHANNEL:
- if ((mpctx->stream->type == STREAMTYPE_DVB)
- && mpctx->stream->priv) {
- dvb_priv_t *priv = (dvb_priv_t *) mpctx->stream->priv;
- if (priv->is_on) {
- if (priv->list->current <= cmd->args[0].v.i)
+ if (mpctx->stream->type == STREAMTYPE_DVB) {
mpctx->last_dvb_step = 1;
- else
- mpctx->last_dvb_step = -1;
if (dvb_set_channel
- (priv, cmd->args[1].v.i, cmd->args[0].v.i))
+ (mpctx->stream, cmd->args[1].v.i, cmd->args[0].v.i))
mpctx->eof = mpctx->dvbin_reopen = 1;
- }
}
break;
#endif /* HAS_DVBIN_SUPPORT */
diff --git a/mplayer.c b/mplayer.c
index 61303f5625..95c7f51132 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3115,11 +3115,8 @@ if(mpctx->sh_video){
if(!mpctx->sh_video && !mpctx->sh_audio){
mp_msg(MSGT_CPLAYER,MSGL_FATAL, MSGTR_NoStreamFound);
#ifdef HAS_DVBIN_SUPPORT
- if((mpctx->stream->type == STREAMTYPE_DVB) && mpctx->stream->priv)
+ if(mpctx->stream->type == STREAMTYPE_DVB)
{
- dvb_priv_t *priv = (dvb_priv_t*) mpctx->stream->priv;
- if(priv->is_on)
- {
int dir;
int v = mpctx->last_dvb_step;
if(v > 0)
@@ -3127,9 +3124,8 @@ if(!mpctx->sh_video && !mpctx->sh_audio){
else
dir = DVB_CHANNEL_LOWER;
- if(dvb_step_channel(priv, dir))
+ if(dvb_step_channel(mpctx->stream, dir))
mpctx->eof = mpctx->dvbin_reopen = 1;
- }
}
#endif
goto goto_next_file; // exit_player(MSGTR_Exit_error);
diff --git a/stream/dvbin.h b/stream/dvbin.h
index 0c615e21e9..1ca1994261 100644
--- a/stream/dvbin.h
+++ b/stream/dvbin.h
@@ -109,8 +109,8 @@ typedef struct {
#define TUNER_CBL 3
#define TUNER_ATSC 4
-extern int dvb_step_channel(dvb_priv_t *, int);
-extern int dvb_set_channel(dvb_priv_t *, int, int);
+extern int dvb_step_channel(stream_t *, int);
+extern int dvb_set_channel(stream_t *, int, int);
extern dvb_config_t *dvb_get_config(void);
#endif
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index f3d023d476..a4a8dd72cc 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -469,11 +469,11 @@ static int dvb_streaming_read(stream_t *stream, char *buffer, int size)
static void dvbin_close(stream_t *stream);
-int dvb_set_channel(dvb_priv_t *priv, int card, int n)
+int dvb_set_channel(stream_t *stream, int card, int n)
{
dvb_channels_list *new_list;
dvb_channel_t *channel;
- stream_t *stream = (stream_t*) priv->stream;
+ dvb_priv_t *priv = stream->priv;
char buf[4096];
dvb_config_t *conf = (dvb_config_t *) priv->config;
int devno;
@@ -557,10 +557,11 @@ int dvb_set_channel(dvb_priv_t *priv, int card, int n)
-int dvb_step_channel(dvb_priv_t *priv, int dir)
+int dvb_step_channel(stream_t *stream, int dir)
{
int new_current;
dvb_channels_list *list;
+ dvb_priv_t *priv = stream->priv;
mp_msg(MSGT_DEMUX, MSGL_V, "DVB_STEP_CHANNEL dir %d\n", dir);
@@ -579,7 +580,7 @@ int dvb_step_channel(dvb_priv_t *priv, int dir)
new_current = (list->NUM_CHANNELS + list->current + (dir == DVB_CHANNEL_HIGHER ? 1 : -1)) % list->NUM_CHANNELS;
- return dvb_set_channel(priv, priv->card, new_current);
+ return dvb_set_channel(stream, priv->card, new_current);
}
@@ -640,7 +641,7 @@ static int dvb_streaming_start(dvb_priv_t *priv, struct stream_priv_s *opts, int
}
- if(!dvb_set_channel(priv, priv->card, priv->list->current))
+ if(!dvb_set_channel(stream, priv->card, priv->list->current))
{
mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR, COULDN'T SET CHANNEL %i: ", priv->list->current);
dvbin_close(stream);