summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvb.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-12-15 13:05:06 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-12-15 13:05:06 +0000
commitc5ad15d8c0f2f41d0a140320cc600655359ed125 (patch)
tree262f5a7eb5aee4a3648f129093e1c60a6035587e /stream/stream_dvb.c
parent9c189c49bfeb1f07753952734881218af3d2358d (diff)
downloadmpv-c5ad15d8c0f2f41d0a140320cc600655359ed125.tar.bz2
mpv-c5ad15d8c0f2f41d0a140320cc600655359ed125.tar.xz
dvb cleanup: call dvb_(set|step)_channel() without dereferencing stream->priv (1000l to me)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25405 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream_dvb.c')
-rw-r--r--stream/stream_dvb.c11
1 files changed, 6 insertions, 5 deletions
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);