summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Freyermuth <o.freyermuth@googlemail.com>2019-10-01 23:40:35 +0200
committerOliver Freyermuth <o.freyermuth@googlemail.com>2019-10-02 01:25:45 +0200
commit1768ea0d1576136130cb5f2b7f459704031bafd2 (patch)
tree1134f01f64b457177762b403cb84360524379ba7
parentc15ec393dd2b75fa0b7c7f567abd16528e43ce44 (diff)
downloadmpv-1768ea0d1576136130cb5f2b7f459704031bafd2.tar.bz2
mpv-1768ea0d1576136130cb5f2b7f459704031bafd2.tar.xz
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.
-rw-r--r--stream/dvbin.h1
-rw-r--r--stream/stream_dvb.c2
2 files changed, 1 insertions, 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++) {