From 1768ea0d1576136130cb5f2b7f459704031bafd2 Mon Sep 17 00:00:00 2001 From: Oliver Freyermuth Date: Tue, 1 Oct 2019 23:40:35 +0200 Subject: stream_dvb: Move stream->is_on initialization to state preparation. Notably, this allows to call dvb_streaming_start more than once, simplifying e.g. channel switching. Also, get rid of unused timeout variable. --- stream/dvbin.h | 1 - stream/stream_dvb.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/stream/dvbin.h b/stream/dvbin.h index 745e77f80a..c184f189e7 100644 --- a/stream/dvbin.h +++ b/stream/dvbin.h @@ -110,7 +110,6 @@ typedef struct { int is_on; int retry; - int timeout; unsigned int last_freq; bool switching_channel; bool stream_used; diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index 0198ba7d8d..a6c98b91bc 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -1026,7 +1026,6 @@ static int dvb_streaming_start(stream_t *stream, char *progname) MP_VERBOSE(stream, "\r\ndvb_streaming_start(PROG: %s, ADAPTER: %d)\n", progname, priv->devno); - state->is_on = 0; list = state->adapters[state->cur_adapter].list; for (i = 0; i < list->NUM_CHANNELS; i ++) { if (!strcmp(list->channels[i].name, progname)) { @@ -1204,6 +1203,7 @@ dvb_state_t *dvb_get_state(stream_t *stream) return NULL; memset(state, 0x00, sizeof(dvb_state_t)); state->switching_channel = false; + state->is_on = 0; state->stream_used = true; state->fe_fd = state->dvr_fd = -1; for (unsigned int i = 0; i < MAX_ADAPTERS; i++) { -- cgit v1.2.3