From 31bb62fae17fe849704c5d3fe78090a3df92cead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Fri, 13 Apr 2007 00:32:19 +0200 Subject: Provide internal functions to lock port rewiring. The introduced function give "frontend like" plugins a chance to lock and unlock port rewiring. This protects such threads (when combined with holding the frontend lock) from beeing blocked when calling functions like xine_get_current_frame(). --- src/xine-engine/xine.c | 10 ++++++++++ src/xine-engine/xine_internal.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index a780aa4dc..1a9a2be4d 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -2133,3 +2133,13 @@ int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *nu return ticket_acquired != 0; } + +int _x_lock_port_rewiring(xine_t *xine, int ms_timeout) +{ + return xine->port_ticket->lock_port_rewiring(xine->port_ticket, ms_timeout); +} + +void _x_unlock_port_rewiring(xine_t *xine) +{ + xine->port_ticket->unlock_port_rewiring(xine->port_ticket); +} diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index db95d064a..4fa31a969 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -371,6 +371,8 @@ struct xine_stream_s { */ int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *num_audio_buffers, int *num_video_frames, int *num_audio_frames) XINE_PROTECTED; +int _x_lock_port_rewiring(xine_t *xine, int ms_to_time_out) XINE_PROTECTED; +void _x_unlock_port_rewiring(xine_t *xine) XINE_PROTECTED; void _x_handle_stream_end (xine_stream_t *stream, int non_user) XINE_PROTECTED; -- cgit v1.2.3