summaryrefslogtreecommitdiff
path: root/src/xine-engine/post.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-05-18 03:16:12 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-05-18 03:16:12 +0000
commite422232e6a5235e12fd143481d7d987d201a5208 (patch)
tree8a7e4db6a8e8b283dc91e33b0181d43a145d2d58 /src/xine-engine/post.c
parent23f2c85267adc425a7b89b91fdc4b36729b87d68 (diff)
downloadxine-lib-e422232e6a5235e12fd143481d7d987d201a5208.tar.gz
xine-lib-e422232e6a5235e12fd143481d7d987d201a5208.tar.bz2
track number of times the port has being opened.
rewiring a closed port won't cause the new destination to be opened. CVS patchset: 6564 CVS date: 2004/05/18 03:16:12
Diffstat (limited to 'src/xine-engine/post.c')
-rw-r--r--src/xine-engine/post.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c
index 88dc4bdc3..7fc7a8f91 100644
--- a/src/xine-engine/post.c
+++ b/src/xine-engine/post.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: post.c,v 1.24 2004/05/18 02:01:39 miguelfreitas Exp $
+ * $Id: post.c,v 1.25 2004/05/18 03:16:12 miguelfreitas Exp $
*/
/*
@@ -619,6 +619,7 @@ static int post_audio_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
port->bits = bits;
port->rate = rate;
port->mode = mode;
+ port->open_count++;
return result;
}
@@ -649,6 +650,7 @@ static void post_audio_close(xine_audio_port_t *port_gen, xine_stream_t *stream)
port->original_port->close(port->original_port, stream);
if (port->port_lock) pthread_mutex_unlock(port->port_lock);
port->stream = NULL;
+ port->open_count--;
_x_post_dec_usage(port);
}
@@ -707,10 +709,12 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) {
this->running_ticket->revoke(this->running_ticket, 1);
- new_port->open(new_port, (input_port->stream == POST_NULL_STREAM) ? NULL : input_port->stream,
- input_port->bits, input_port->rate, input_port->mode);
- input_port->original_port->close(input_port->original_port,
- (input_port->stream == POST_NULL_STREAM) ? NULL : input_port->stream);
+ if( input_port->open_count ) {
+ new_port->open(new_port, (input_port->stream == POST_NULL_STREAM) ? NULL : input_port->stream,
+ input_port->bits, input_port->rate, input_port->mode);
+ input_port->original_port->close(input_port->original_port,
+ (input_port->stream == POST_NULL_STREAM) ? NULL : input_port->stream);
+ }
input_port->original_port = new_port;
this->running_ticket->issue(this->running_ticket, 1);
@@ -764,7 +768,7 @@ post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_
xine_list_append_content(post->output, *output);
}
- original->status(original, port->stream, &port->bits, &port->rate, &port->mode);
+ port->open_count = 0;
return port;
}