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).
This commit is contained in:
Oliver Freyermuth
2016-01-08 18:37:30 +01:00
committed by wm4
parent 1e46bda0f8
commit c55b242b4e
2 changed files with 21 additions and 1 deletions

View File

@@ -103,6 +103,7 @@ typedef struct {
int timeout;
int last_freq;
bool switching_channel;
bool stream_used;
} dvb_state_t;
typedef struct dvb_params {