diff options
| author | Reinhard Nißl <rnissl@gmx.de> | 2007-04-13 00:17:30 +0200 |
|---|---|---|
| committer | Reinhard Nißl <rnissl@gmx.de> | 2007-04-13 00:17:30 +0200 |
| commit | 0638ad373d88c3ed45273a505df56626daba19a0 (patch) | |
| tree | 5df24fd7d6686f057a3fa90f486cae6ddd27a350 /src/xine-engine/post.c | |
| parent | b4304f243c6006eec3ca4b4ce2b19cfca703861a (diff) | |
| download | xine-lib-0638ad373d88c3ed45273a505df56626daba19a0.tar.gz xine-lib-0638ad373d88c3ed45273a505df56626daba19a0.tar.bz2 | |
Provide ability to lock port rewiring.
The idea is to allow only a "single" frontend to rewire ports at
a certain point in time. Regarding a stream, frontend_lock is used
for example to allow only a single frontend to change the speed.
Unfortunately, frontend_lock cannot be used as the rewire functions
are not stream related.
Therefore a new port_rewiring_lock was introduced and used at
appropriate locations. When an arbitrary thread now holds the
frontend_lock and the port_rewiring_lock, it is safe that acquiring
a port ticket in functions like xine_get_current_frame() will
never block the thread.
Diffstat (limited to 'src/xine-engine/post.c')
| -rw-r--r-- | src/xine-engine/post.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index 6ae96e982..58e9b633c 100644 --- a/src/xine-engine/post.c +++ b/src/xine-engine/post.c @@ -192,6 +192,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) { if (!new_port) return 0; + this->running_ticket->lock_port_rewiring(this->running_ticket, -1); this->running_ticket->revoke(this->running_ticket, 1); if (input_port->original_port->status(input_port->original_port, input_port->stream, @@ -202,6 +203,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) { input_port->original_port = new_port; this->running_ticket->issue(this->running_ticket, 1); + this->running_ticket->unlock_port_rewiring(this->running_ticket); return 1; } @@ -680,6 +682,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) { if (!new_port) return 0; + this->running_ticket->lock_port_rewiring(this->running_ticket, -1); this->running_ticket->revoke(this->running_ticket, 1); if (input_port->original_port->status(input_port->original_port, input_port->stream, @@ -690,6 +693,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) { input_port->original_port = new_port; this->running_ticket->issue(this->running_ticket, 1); + this->running_ticket->unlock_port_rewiring(this->running_ticket); return 1; } |
