From c55b242b4ee89e91b4f9896e214c3bbe0ed46ea1 Mon Sep 17 00:00:00 2001 From: Oliver Freyermuth Date: Fri, 8 Jan 2016 18:37:30 +0100 Subject: 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). --- stream/dvbin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'stream/dvbin.h') 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 { -- cgit v1.2.3