summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authoruid86226 <none@none>2004-02-16 20:19:09 +0000
committeruid86226 <none@none>2004-02-16 20:19:09 +0000
commit5807b51c46b31abe0fecedb8f1a783f2bd74a18d (patch)
treedb5924af7c3bf12972a2e99854a76b8914d1fb99 /src/xine-engine
parent76b4bde43bb287a9b4cbfe92b4af5e1dd40ee311 (diff)
downloadxine-lib-5807b51c46b31abe0fecedb8f1a783f2bd74a18d.tar.gz
xine-lib-5807b51c46b31abe0fecedb8f1a783f2bd74a18d.tar.bz2
fix freezes with input plugins that play with the speed:
* use _x_set_speed() for speed manipulations, since it is ticket-safe * _x_set_speed() is an internal helper function now, move frontend locking outside of it * restrict access to metronom clock internal stuff CVS patchset: 6165 CVS date: 2004/02/16 20:19:09
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/metronom.c3
-rw-r--r--src/xine-engine/metronom.h29
-rw-r--r--src/xine-engine/xine.c7
-rw-r--r--src/xine-engine/xine_interface.c4
4 files changed, 32 insertions, 11 deletions
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index b301fdd25..acf96cab7 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.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: metronom.c,v 1.134 2004/01/18 18:18:31 mroi Exp $
+ * $Id: metronom.c,v 1.135 2004/02/16 20:19:09 uid86226 Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -41,6 +41,7 @@
*/
#define METRONOM_INTERNAL
+#define METRONOM_CLOCK_INTERNAL
#include "xine_internal.h"
#include "metronom.h"
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index 2f14f0388..9a0019692 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -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: metronom.h,v 1.56 2003/11/20 00:42:14 tmattern Exp $
+ * $Id: metronom.h,v 1.57 2004/02/16 20:19:10 uid86226 Exp $
*
* metronom: general pts => virtual calculation/assoc
*
@@ -237,6 +237,7 @@ struct metronom_s {
metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine);
+/* FIXME: reorder this structure on the next cleanup to remove the dummies */
struct metronom_clock_s {
/*
@@ -249,6 +250,7 @@ struct metronom_clock_s {
* system clock reference (SCR) functions
*/
+#ifdef METRONOM_CLOCK_INTERNAL
/*
* start clock (no clock reset)
* at given pts
@@ -266,6 +268,11 @@ struct metronom_clock_s {
* resume clock from where it was stopped
*/
void (*resume_clock) (metronom_clock_t *self);
+#else
+ void *dummy1;
+ void *dummy2;
+ void *dummy3;
+#endif
/*
@@ -279,13 +286,16 @@ struct metronom_clock_s {
*/
void (*adjust_clock) (metronom_clock_t *self, int64_t desired_pts);
-
+#ifdef METRONOM_CLOCK_INTERNAL
/*
* set clock speed
* for constants see xine_internal.h
*/
int (*set_speed) (metronom_clock_t *self, int speed);
+#else
+ void *dummy4;
+#endif
/*
* (un)register a System Clock Reference provider at the metronom
@@ -293,6 +303,7 @@ struct metronom_clock_s {
int (*register_scr) (metronom_clock_t *self, scr_plugin_t *scr);
void (*unregister_scr) (metronom_clock_t *self, scr_plugin_t *scr);
+#ifdef METRONOM_CLOCK_INTERNAL
void (*exit) (metronom_clock_t *self);
xine_t *xine;
@@ -302,12 +313,22 @@ struct metronom_clock_s {
pthread_t sync_thread;
int thread_running;
int scr_adjustable;
+#else
+ void *dummy5;
+ void *dummy6;
+ void *dummy7;
+ void *dummy8;
+ pthread_t dummy9;
+ int dummy10;
+ int dummy11;
+#endif
int speed;
-
+
+#ifdef METRONOM_CLOCK_INTERNAL
pthread_mutex_t lock;
pthread_cond_t cancel;
-
+#endif
};
metronom_clock_t *_x_metronom_clock_init(xine_t *xine);
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 9564c8d25..282cc2db3 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.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: xine.c,v 1.282 2004/02/15 20:31:23 mroi Exp $
+ * $Id: xine.c,v 1.283 2004/02/16 20:19:10 uid86226 Exp $
*/
/*
@@ -54,6 +54,7 @@
#define XINE_ENABLE_EXPERIMENTAL_FEATURES
#define XINE_ENGINE_INTERNAL
+#define METRONOM_CLOCK_INTERNAL
#include "xine_internal.h"
#include "plugin_catalog.h"
@@ -1539,8 +1540,6 @@ int xine_get_status (xine_stream_t *stream) {
void _x_set_speed (xine_stream_t *stream, int speed) {
- pthread_mutex_lock (&stream->frontend_lock);
-
if (speed <= XINE_SPEED_PAUSE)
speed = XINE_SPEED_PAUSE;
else if (speed > XINE_SPEED_FAST_4)
@@ -1551,8 +1550,6 @@ void _x_set_speed (xine_stream_t *stream, int speed) {
if (stream->slave && (stream->slave_affection & XINE_MASTER_SLAVE_SPEED))
__set_speed_internal (stream->slave, speed);
-
- pthread_mutex_unlock (&stream->frontend_lock);
}
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index e1a8abcb0..9ea2ffbd5 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.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: xine_interface.c,v 1.78 2004/02/12 18:19:12 mroi Exp $
+ * $Id: xine_interface.c,v 1.79 2004/02/16 20:19:10 uid86226 Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -329,7 +329,9 @@ void xine_set_param (xine_stream_t *stream, int param, int value) {
switch (param) {
case XINE_PARAM_SPEED:
+ pthread_mutex_lock (&stream->frontend_lock);
_x_set_speed (stream, value);
+ pthread_mutex_unlock (&stream->frontend_lock);
break;
case XINE_PARAM_AV_OFFSET: