summaryrefslogtreecommitdiffstats
path: root/stream/dvbin.h
diff options
context:
space:
mode:
authorOliver Freyermuth <o.freyermuth@googlemail.com>2016-01-08 18:37:30 +0100
committerwm4 <wm4@nowhere>2016-01-14 00:36:53 +0100
commitc55b242b4ee89e91b4f9896e214c3bbe0ed46ea1 (patch)
tree49f7fa336fad5d906dc602d0465b95c2b0c04785 /stream/dvbin.h
parent1e46bda0f86d9d58c38135c7b9ddbb6dbb7c3572 (diff)
downloadmpv-c55b242b4ee89e91b4f9896e214c3bbe0ed46ea1.tar.bz2
mpv-c55b242b4ee89e91b4f9896e214c3bbe0ed46ea1.tar.xz
stream_dvb: global protection mutex and usage bit for global_dvb_state.
The mutex is used in dvbin_open and dvbin_close only since these are the only entry / exit points to the stream. When opening, it is first checked (mutexed) whether the state already exists and is in use, then a STREAM_ERROR is returned, since there may be only one stream_dvb active at a time. State-creation itself is also protected by mutex. In dvbin_close, the usage-bit is set to false (mutexed) in case of channel switch. In case of stream-teardown, the state is destructed (also protected by mutex).
Diffstat (limited to 'stream/dvbin.h')
-rw-r--r--stream/dvbin.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/stream/dvbin.h b/stream/dvbin.h
index cf0a41a502..e0688aa79e 100644
--- a/stream/dvbin.h
+++ b/stream/dvbin.h
@@ -103,6 +103,7 @@ typedef struct {
int timeout;
int last_freq;
bool switching_channel;
+ bool stream_used;
} dvb_state_t;
typedef struct dvb_params {