10
26
+x-content/video-dvd
11
27
+x-content/video-svcd
12
28
+x-content/video-vcd
13
--- gxine-0.5.905.orig/m4/_js.m4
14
+++ gxine-0.5.905/m4/_js.m4
15
@@ -41,6 +41,8 @@ AC_DEFUN([GXINE_PATH_SPIDERMONKEY],
16
[AS_HELP_STRING([--with-spidermonkey],[prefix where libjs/libsmjs is installed (optional)])],
17
[JS_CFLAGS="-I$withval"], [])
19
+ AC_ARG_ENABLE([mozjs185],
20
+ [AS_HELP_STRING([--disable-mozjs185],[don't look for system libmozjs185])])
21
AC_ARG_ENABLE([mozjs],
22
[AS_HELP_STRING([--disable-mozjs],[don't look for Mozilla libmozjs])])
24
@@ -51,11 +53,20 @@ AC_DEFUN([GXINE_PATH_SPIDERMONKEY],
25
if test x"$JS_CFLAGS" = x; then
26
AC_MSG_NOTICE([looking for the Spidermonkey Javascript library in various places.])
28
- # Try libmozjs (xulrunner)
30
+ AC_MSG_NOTICE([trying mozjs via pkgconfig mozjs185])
31
+ PKG_CHECK_MODULES([JS],[mozjs185],[],[:])
34
- AC_MSG_NOTICE([trying mozjs via pkgconfig xulrunner-js])
35
- PKG_CHECK_MODULES([JS],[xulrunner-js],[],[:])
36
+ if test x"$JS_CFLAGS" = x; then
40
+ # Try libmozjs (xulrunner)
41
+ if test x"$JS_CFLAGS" = x; then
43
+ AC_MSG_NOTICE([trying mozjs via pkgconfig xulrunner-js])
44
+ PKG_CHECK_MODULES([JS],[xulrunner-js],[],[:])
49
@@ -118,6 +129,7 @@ AC_DEFUN([GXINE_PATH_SPIDERMONKEY],
53
+ JSLIB="${JS_LIBS}js"
54
JS_LIBS="`spidermonkey_locate_lib([$JS_LIBS])`js"
55
AC_DEFINE(HAVE_LIBSMJS, 1, [Define if you have jsapi.h])
57
@@ -125,6 +137,43 @@ AC_DEFUN([GXINE_PATH_SPIDERMONKEY],
59
CFLAGS="$saved_CFLAGS"
63
+ LIBS="$JS_LIBS $LIBS"
64
+ SAVED_CFLAGS="$CFLAGS"
65
+ CFLAGS="$JS_CFLAGS $CFLAGS"
66
+ AC_CHECK_LIB([$JSLIB], [JS_NewCompartmentAndGlobalObject],
67
+ AC_DEFINE([HAVE_COMPARTMENTS], [1], [Define whether we have compartments]))
69
+ AC_CHECK_LIB([$JSLIB], [JS_GetStringBytes],
70
+ AC_DEFINE([HAVE_JS_GET_STRING_BYTES], [1], [Define whether we have JS_GetStringBytes]))
72
+ AC_CHECK_LIB([$JSLIB], [JS_NewDouble],
73
+ AC_DEFINE([HAVE_JS_NEW_DOUBLE], [1], [Define whether we have JS_NewDouble]))
75
+ AC_CHECK_LIB([$JSLIB], [JS_StrictPropertyStub],
76
+ AC_DEFINE([HAVE_JS_STRICT_PROPERTY_OP], [1], [Define whether we have the JSStrictPropertyOp prototype]))
80
+ [[#include <jsapi.h>]],
81
+ [[jsval v; jsdouble *d = JSVAL_TO_DOUBLE(v);]]
83
+ AC_DEFINE([JSVAL_TO_DOUBLE_RETURNS_POINTER], [1], [Define whether the JSVAL_TO_DOUBLE function or macro returns a pointer to jsdouble])
86
+ CFLAGS="$JS_CFLAGS -Werror -Wno-attributes"
89
+ [[#include <jsapi.h>
90
+ static JSBool op(JSContext* cx, JSObject* obj, jsid id, jsval* vp) {}]],
91
+ [[JSPropertyOp func = op;]]
93
+ AC_DEFINE([JS_PROPERTY_OP_HAS_ID_AS_JSID], [1], [Define whether the type of id in the prototype for JSPropertyOp is a jsid])
96
+ CFLAGS="$SAVED_CFLAGS"
101
--- gxine-0.5.905.orig/src/script_engine.c
102
+++ gxine-0.5.905/src/script_engine.c
106
#include <gdk/gdkkeysyms.h>
109
#include "script_engine.h"
112
#include "snapshot.h"
119
@@ -194,7 +194,10 @@ gchar *se_result_str (se_t *se)
122
se->str = JS_ValueToString (se->cx, se->rval);
123
- return JS_GetStringBytes (se->str);
124
+ char *encoded = SE_JS_ENCODE_STRING(se->cx, se->str);
125
+ char *res = strdup(encoded);
126
+ SE_JS_FREE_ENCODED_STRING(se->cx, encoded);
130
int se_result_int (se_t *se, JSInt32 *num)
131
@@ -253,8 +256,7 @@ se_js_string_val (JSContext *cx, const c
135
-static JSBool controls_exit (JSContext *cx, JSObject *obj, uintN argc,
136
- jsval *argv, jsval *rval)
137
+static JSBool controls_exit (JSContext *cx, uintN argc, jsval *vp)
141
@@ -299,8 +301,7 @@ static JSBool controls_exit (JSContext *
145
-static JSBool show_js_console (JSContext *cx, JSObject *obj, uintN argc,
146
- jsval *argv, jsval *rval)
147
+static JSBool show_js_console (JSContext *cx, uintN argc, jsval *vp)
149
se_log_fncall_checkinit ("show_js_console");
150
if (GTK_WIDGET_VISIBLE (se_window))
151
@@ -311,85 +312,93 @@ static JSBool show_js_console (JSContext
152
se_prop_set_int (gse, js_icon_obj, "v", 0);
155
- *rval = JSVAL_VOID;
156
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
161
-js_callback (JSContext *cx, JSObject *obj,
162
- uintN argc, jsval *argv, jsval *rval)
163
+js_callback (JSContext *cx, uintN argc, jsval *vp)
165
+ jsval *argv = JS_ARGV (cx, vp);
166
se_t *se = (se_t *) JS_GetContextPrivate (cx);
167
se_log_fncall ("callback");
168
se_argc_check_range (1, 2, "callback");
169
se_arg_is_string (0, "callback");
171
se_arg_is_object (1, "callback");
172
- engine_queue_push (JS_GetStringBytes (JS_ValueToString (cx, argv[0])),
173
- JS_GetPrivate (cx, argc > 1 ? JSVAL_TO_OBJECT (argv[1])
175
- NULL, NULL, NULL, _("JS callback"));
176
- *rval = JSVAL_VOID;
177
+ char *str = SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[0]));
178
+ engine_queue_push (str,
179
+ JS_GetPrivate (cx, argc > 1 ? JSVAL_TO_OBJECT (argv[1])
181
+ NULL, NULL, NULL, _("JS callback"));
182
+ SE_JS_FREE_ENCODED_STRING (cx, str);
183
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
188
-js_xine_cfg_get (JSContext *cx, JSObject *obj,
189
- uintN argc, jsval *argv, jsval *rval)
190
+js_xine_cfg_get (JSContext *cx, uintN argc, jsval *vp)
192
+ jsval *argv = JS_ARGV (cx, vp);
193
se_log_fncall ("xine_cfg_get");
194
se_argc_check (1, "xine_cfg_get");
195
se_arg_is_string (0, "xine_cfg_get");
197
xine_cfg_entry_t entry;
198
- char *cfg = JS_GetStringBytes (JS_ValueToString (cx, argv[0]));
199
+ char *cfg = SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[0]));
200
if (!xine_config_lookup_entry (xine, cfg, &entry))
202
- *rval = JSVAL_NULL;
203
+ JS_SET_RVAL (cx, vp, JSVAL_NULL);
204
+ SE_JS_FREE_ENCODED_STRING (cx, cfg);
208
+ SE_JS_FREE_ENCODED_STRING(cx, cfg);
212
case XINE_CONFIG_TYPE_RANGE:
213
case XINE_CONFIG_TYPE_NUM:
214
- *rval = INT_TO_JSVAL (entry.num_value);
215
+ JS_SET_RVAL (cx, vp, INT_TO_JSVAL (entry.num_value));
218
case XINE_CONFIG_TYPE_BOOL:
219
- *rval = BOOLEAN_TO_JSVAL (entry.num_value);
220
+ JS_SET_RVAL (cx, vp, BOOLEAN_TO_JSVAL (entry.num_value));
223
case XINE_CONFIG_TYPE_STRING:
224
- *rval = se_js_string_val (cx, entry.str_value ? : entry.str_default);
225
+ JS_SET_RVAL (cx, vp, se_js_string_val (cx, entry.str_value ? : entry.str_default));
228
case XINE_CONFIG_TYPE_ENUM:
229
- *rval = se_js_string_val (cx, entry.enum_values[entry.num_value]);
230
+ JS_SET_RVAL (cx, vp, se_js_string_val (cx, entry.enum_values[entry.num_value]));
234
- *rval = JSVAL_NULL;
235
+ JS_SET_RVAL (cx, vp, JSVAL_NULL);
241
-js_xine_cfg_set (JSContext *cx, JSObject *obj,
242
- uintN argc, jsval *argv, jsval *rval)
243
+js_xine_cfg_set (JSContext *cx, uintN argc, jsval *vp)
245
+ jsval *argv = JS_ARGV (cx, vp);
246
se_log_fncall ("xine_cfg_set");
247
se_argc_check (2, "xine_cfg_set");
248
se_arg_is_string (0, "xine_cfg_set");
250
xine_cfg_entry_t entry;
251
- char *cfg = JS_GetStringBytes (JS_ValueToString (cx, argv[0]));
252
+ char *cfg = SE_JS_ENCODE_STRING (cx, JS_ValueToString(cx, argv[0]));
253
if (!xine_config_lookup_entry (xine, cfg, &entry))
255
- *rval = JSVAL_VOID;
256
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
257
+ SE_JS_FREE_ENCODED_STRING (cx, cfg);
261
+ SE_JS_FREE_ENCODED_STRING (cx, cfg);
266
@@ -413,28 +422,34 @@ js_xine_cfg_set (JSContext *cx, JSObject
268
case XINE_CONFIG_TYPE_STRING:
269
se_arg_is_string (1, "xine_cfg_set");
270
- entry.str_value = JS_GetStringBytes (JS_ValueToString (cx, argv[1]));
271
+ entry.str_value = SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[1]));
274
case XINE_CONFIG_TYPE_ENUM:
275
se_arg_is_string (1, "xine_cfg_set");
276
- char *v = JS_GetStringBytes (JS_ValueToString (cx, argv[1]));
277
+ char *v = SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[1]));
279
for (i = 0; entry.enum_values[i]; ++i)
280
- if (!strcmp (v, entry.enum_values[i]))
281
+ if (!strcmp (v, entry.enum_values[i])) {
282
+ SE_JS_FREE_ENCODED_STRING (cx, v);
285
if (entry.enum_values[i])
287
+ SE_JS_FREE_ENCODED_STRING (cx, v);
291
- *rval = JSVAL_VOID;
292
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
296
preferences_update_entry (&entry);
298
- *rval = JSVAL_VOID;
299
+ if (entry.type == XINE_CONFIG_TYPE_STRING)
300
+ SE_JS_FREE_ENCODED_STRING (cx, entry.str_value);
302
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
306
@@ -476,8 +491,7 @@ static char *show_help_int (se_t *se, se
310
-static JSBool show_help (JSContext *cx, JSObject *obj, uintN argc,
311
- jsval *argv, jsval *rval)
312
+static JSBool show_help (JSContext *cx, uintN argc, jsval *vp)
314
static char *const group_id[] = {
316
@@ -530,7 +544,7 @@ static JSBool show_help (JSContext *cx,
320
- *rval = JSVAL_VOID;
321
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
325
@@ -652,8 +666,9 @@ static jsval get_prop_jsval (se_t *se, s
329
- jsdouble *d = JS_NewDouble (se->cx, get_prop_double (se, o, p));
330
- return DOUBLE_TO_JSVAL (d);
332
+ SE_JS_NEW_NUMBER_VAL (se->cx, get_prop_double (se, o, p), rval);
337
@@ -692,7 +707,7 @@ static void set_prop_jsval (se_t *se, se
340
if (JSVAL_IS_NUMBER(*v))
341
- se_prop_set_double (se, o, p->id, *JSVAL_TO_DOUBLE(*v));
342
+ se_prop_set_double (se, o, p->id, SE_JSVAL_TO_DOUBLE(*v));
344
se->print_cb (se->print_cb_data, _("\n%s.%s: value must be numeric\n"),
346
@@ -709,8 +724,9 @@ static void set_prop_jsval (se_t *se, se
349
JSString *str = JSVAL_TO_STRING(*v);
350
- char *string = JS_GetStringBytes (str);
351
+ char *string = SE_JS_ENCODE_STRING (se->cx, str);
352
se_prop_set (se, o, p->id, string);
353
+ SE_JS_FREE_ENCODED_STRING (se->cx, str);
357
@@ -725,17 +741,17 @@ static void set_prop_jsval (se_t *se, se
358
* function to create and maintain js objects
362
-generic_JSGetProperty (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
363
+SE_JS_PROPERTY_GETTER_DECLARE (generic_JSGetProperty)
365
+ SE_JS_PROPERTY_GETTER_INIT_VARIABLES (id_val);
366
se_t *se = (se_t *) JS_GetContextPrivate(cx);
367
se_log_fncall ("generic get property");
368
se_o_t *o = JS_GetPrivate (cx, obj);
370
- if (JSVAL_IS_STRING (id))
371
+ if (JSVAL_IS_STRING (id_val))
373
- JSString *str = JS_ValueToString (cx, id);
374
- char *prop = str ? JS_GetStringBytes (str) : "";
375
+ JSString *str = JS_ValueToString (cx, id_val);
376
+ char *prop = str ? SE_JS_ENCODE_STRING (cx, str) : "";
379
logprintf ("script_engine: looking for generic property '%s' in '%s'\n",
380
@@ -749,6 +765,9 @@ generic_JSGetProperty (JSContext *cx, JS
381
if (!strcasecmp (p->id, prop))
383
*vp = get_prop_jsval (se, o, p);
385
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
390
@@ -760,18 +779,25 @@ generic_JSGetProperty (JSContext *cx, JS
391
se_o_t *p = (se_o_t *) n->data;
392
if (!strcasecmp (p->id, prop))
394
- static jsval prop = 0;
396
- prop = se_js_string_val (cx, ".");
397
- if (!generic_JSGetProperty (cx, p->obj, prop, vp))
398
+ jsval prop_val = se_js_string_val (cx, ".");
399
+ if (!SE_JS_CALL_PROPERTY_GETTER_WITH_JSVAL (generic_JSGetProperty, cx, p->obj, prop_val, vp))
400
*vp = OBJECT_TO_JSVAL (p->obj);
402
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
408
- if (*prop && o->parent)
409
- return generic_JSGetProperty (cx, o->parent->obj, id, vp);
410
+ if (*prop && o->parent) {
411
+ JSBool ret = generic_JSGetProperty (cx, o->parent->obj, id, vp);
413
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
418
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
422
@@ -780,9 +806,9 @@ generic_JSGetProperty (JSContext *cx, JS
427
-generic_JSSetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
428
+SE_JS_PROPERTY_SETTER_DECLARE(generic_JSSetProperty)
430
+ SE_JS_PROPERTY_SETTER_INIT_VARIABLES (id_val);
431
se_t *se = (se_t *) JS_GetContextPrivate(cx);
434
@@ -790,10 +816,10 @@ generic_JSSetProperty(JSContext *cx, JSO
436
o = JS_GetPrivate (cx, obj);
438
- if (JSVAL_IS_STRING (id))
439
+ if (JSVAL_IS_STRING (id_val))
441
- JSString *str = JS_ValueToString (cx, id);
442
- char *prop = JS_GetStringBytes (str);
443
+ JSString *str = JS_ValueToString (cx, id_val);
444
+ char *prop = SE_JS_ENCODE_STRING (cx, str);
447
logprintf ("script_engine: looking for generic property '%s' in '%s'\n",
448
@@ -808,6 +834,7 @@ generic_JSSetProperty(JSContext *cx, JSO
451
set_prop_jsval (se, o, p, vp);
452
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
456
@@ -819,15 +846,21 @@ generic_JSSetProperty(JSContext *cx, JSO
457
se_o_t *p = (se_o_t *) n->data;
458
if (!strcasecmp (p->id, prop))
460
- if (!generic_JSSetProperty (cx, p->obj, STRING_TO_JSVAL("."), vp))
461
+ jsval prop_val = STRING_TO_JSVAL(".");
462
+ if (!SE_JS_CALL_PROPERTY_SETTER_WITH_JSVAL (generic_JSSetProperty, cx, p->obj, prop_val, vp))
463
*vp = OBJECT_TO_JSVAL (p->obj);
464
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
469
- if (*prop && o->parent)
470
- return generic_JSSetProperty (cx, o->parent->obj, id, vp);
471
+ if (*prop && o->parent) {
472
+ JSBool ret = SE_JS_CALL_PROPERTY_SETTER_WITH_JSVAL (generic_JSSetProperty, cx, o->parent->obj, id_val, vp);
473
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
477
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
481
@@ -841,14 +874,35 @@ static void generic_JSDestructor (JSCont
482
se_log_fncall ("generic destructor");
485
+#ifdef JSFUN_CONSTRUCTOR
486
+static JSBool generic_Constructor (JSContext* cx, uintN argc, jsval* vp)
488
+ JSObject* obj = JS_NewObjectForConstructor (cx, vp);
490
+ JS_ReportError (cx, "Failed to create 'this' object");
494
+ JS_SET_RVAL (cx, vp, OBJECT_TO_JSVAL (obj));
499
static JSClass generic_JSClass =
501
"view", JSCLASS_HAS_PRIVATE,
502
JS_PropertyStub, JS_PropertyStub,
503
generic_JSGetProperty, generic_JSSetProperty,
504
JS_EnumerateStub, JS_ResolveStub,
505
+#ifndef JSFUN_CONSTRUCTOR
506
JS_ConvertStub, generic_JSDestructor
509
+ JS_ConvertStub, generic_JSDestructor,
510
+ NULL, NULL, NULL, generic_Constructor,
511
+ NULL, NULL, NULL, NULL
515
se_o_t *se_create_object (se_t *se, se_o_t *parent /* may be NULL */,
516
const gchar *name, void *user_data,
517
@@ -1542,7 +1596,7 @@ se_t *se_new (void)
520
static JSClass global_class = {
521
- "global", JSCLASS_HAS_PRIVATE,
522
+ "global", JSCLASS_HAS_PRIVATE | JSCLASS_GLOBAL_FLAGS,
523
JS_PropertyStub,JS_PropertyStub,JS_PropertyStub,JS_PropertyStub,
524
JS_EnumerateStub,JS_ResolveStub,JS_ConvertStub,JS_FinalizeStub
526
@@ -1564,7 +1618,13 @@ se_t *se_new (void)
527
se = malloc (sizeof (se_t));
529
se->cx = JS_NewContext (rt, 0x1000);
530
+#ifdef HAVE_COMPARTMENTS
531
+ se->global = JS_NewCompartmentAndGlobalObject (se->cx, &global_class, NULL);
532
+ /* Select the compartment our global object is in */
533
+ JS_EnterCrossCompartmentCall (se->cx, se->global);
535
se->global = JS_NewObject (se->cx, &global_class, NULL, NULL);
538
pthread_mutexattr_t attr;
539
pthread_mutexattr_init (&attr);
540
@@ -1596,12 +1656,12 @@ se_t *se_new (void)
543
static const se_f_def_t defs[] = {
544
- { "exit", controls_exit, 0, 0, SE_GROUP_ENGINE, NULL, NULL },
545
- { "js_console_show", show_js_console, 0, 0, SE_GROUP_DIALOGUE, NULL, NULL },
546
- { "help", show_help, 0, 0, SE_GROUP_HIDDEN, NULL, NULL },
547
- { "callback", js_callback, 0, 0, SE_GROUP_ENGINE, N_("Javascript"), NULL },
548
- { "xine_cfg_get", js_xine_cfg_get, 0, 0, SE_GROUP_PROPERTIES, NULL, NULL },
549
- { "xine_cfg_set", js_xine_cfg_set, 0, 0, SE_GROUP_PROPERTIES, NULL, NULL },
550
+ { "exit", controls_exit, 0, JSFUN_FAST_NATIVE, SE_GROUP_ENGINE, NULL, NULL },
551
+ { "js_console_show", show_js_console, 0, JSFUN_FAST_NATIVE, SE_GROUP_DIALOGUE, NULL, NULL },
552
+ { "help", show_help, 0, JSFUN_FAST_NATIVE, SE_GROUP_HIDDEN, NULL, NULL },
553
+ { "callback", js_callback, 0, JSFUN_FAST_NATIVE, SE_GROUP_ENGINE, N_("Javascript"), NULL },
554
+ { "xine_cfg_get", js_xine_cfg_get, 0, JSFUN_FAST_NATIVE, SE_GROUP_PROPERTIES, NULL, NULL },
555
+ { "xine_cfg_set", js_xine_cfg_set, 0, JSFUN_FAST_NATIVE, SE_GROUP_PROPERTIES, NULL, NULL },
558
se_defuns (se, se->g, defs);
559
--- gxine-0.5.905.orig/src/ui.c
560
+++ gxine-0.5.905/src/ui.c
561
@@ -490,14 +490,14 @@ static void set_fs_toolbar_top (int v)
563
#ifdef WITH_DEPRECATED
565
-static JSBool js_fs_toolbar_show (JSContext *cx, JSObject *obj, uintN argc,
566
- jsval *argv, jsval *rval)
567
+static JSBool js_fs_toolbar_show (JSContext *cx, uintN argc, jsval *vp)
571
se_log_fncall_deprecated ("toolbar_show");
572
se_argc_check_max (1, "toolbar_show");
574
+ jsval *argv = JS_ARGV (cx, vp);
577
se_arg_is_int_or_bool (0, "toolbar_show");
578
@@ -508,19 +508,20 @@ static JSBool js_fs_toolbar_show (JSCont
580
window_fs_toolbar_show (show);
582
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
588
-static JSBool js_fs_toolbar_position (JSContext *cx, JSObject *obj, uintN argc,
589
- jsval *argv, jsval *rval)
590
+static JSBool js_fs_toolbar_position (JSContext *cx, uintN argc, jsval *vp)
594
se_log_fncall_obsolete ("set_toolbar_position");
595
se_argc_check_max (1, "set_toolbar_position");
597
+ jsval *argv = JS_ARGV (cx, vp);
600
se_arg_is_int_or_bool (0, "set_toolbar_position");
601
@@ -532,6 +533,7 @@ static JSBool js_fs_toolbar_position (JS
603
(gtk_radio_action_get_current_value (action_items.fs_toolbar_pos->data));
605
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
609
@@ -549,23 +551,21 @@ static int ui_lookup_js_obj (const JSObj
610
abort (); /* can't happen */
613
-static JSBool js_control_revert (JSContext *cx, JSObject *obj, uintN argc,
614
- jsval *argv, jsval *rval)
615
+static JSBool js_control_revert (JSContext *cx, uintN argc, jsval *vp)
617
se_log_fncall ("<control>.revert");
618
se_argc_check (0, "<control>.revert");
619
- ui_revert_control_adjustment (ui_lookup_js_obj (obj));
620
- *rval = JSVAL_VOID;
621
+ ui_revert_control_adjustment (ui_lookup_js_obj (JS_THIS_OBJECT (cx, vp)));
622
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
626
-static JSBool js_control_reset (JSContext *cx, JSObject *obj, uintN argc,
627
- jsval *argv, jsval *rval)
628
+static JSBool js_control_reset (JSContext *cx, uintN argc, jsval *vp)
630
se_log_fncall ("<control>.reset");
631
se_argc_check (0, "<control>.reset");
632
- ui_clear_control_adjustment (ui_lookup_js_obj (obj));
633
- *rval = JSVAL_VOID;
634
+ ui_clear_control_adjustment (ui_lookup_js_obj (JS_THIS_OBJECT (cx, vp)));
635
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
639
@@ -654,13 +654,12 @@ static int ui_prop_set_bool (void *data,
640
return ui_prop_set_internal (data, !!value.i);
643
-static JSBool ui_prop_toggle_bool (JSContext *cx, JSObject *obj,
644
- uintN argc, jsval *argv, jsval *rval)
645
+static JSBool ui_prop_toggle_bool (JSContext *cx, uintN argc, jsval *vp)
647
se_t *se = (se_t *) JS_GetContextPrivate(cx);
648
- se_o_t *o = JS_GetPrivate (cx, obj);
649
+ se_o_t *o = JS_GetPrivate (cx, JS_THIS_OBJECT (cx, vp));
650
JSBool v = !se_prop_get_bool (se, o, "v");
651
- *rval = BOOLEAN_TO_JSVAL (v);
652
+ JS_SET_RVAL (cx, vp, BOOLEAN_TO_JSVAL (v));
653
se_prop_set_bool (se, o, "v", v);
656
@@ -699,7 +698,7 @@ void ui_create_properties (const ui_prop
657
se_prop_create_int (gse, obj, "max", prop[i].max, TRUE);
660
- se_defun (gse, obj, "toggle", ui_prop_toggle_bool, 0, 0,
661
+ se_defun (gse, obj, "toggle", ui_prop_toggle_bool, 0, JSFUN_FAST_NATIVE,
662
SE_GROUP_HIDDEN, NULL, NULL);
664
default:; /* we don't handle string and float */
665
@@ -1044,10 +1043,10 @@ void ui_init (void)
667
#ifdef WITH_DEPRECATED
668
static const se_f_def_t defs[] = {
669
- { "toolbar_show", js_fs_toolbar_show, 0, 0,
670
+ { "toolbar_show", js_fs_toolbar_show, 0, JSFUN_FAST_NATIVE,
671
SE_GROUP_HIDDEN, N_("[bool]"), NULL },
673
- { "set_toolbar_position", js_fs_toolbar_position, 0, 0,
674
+ { "set_toolbar_position", js_fs_toolbar_position, 0, JSFUN_FAST_NATIVE,
675
SE_GROUP_HIDDEN, N_("bool"), N_("at top if true") },
678
@@ -1091,8 +1090,8 @@ void ui_init (void)
679
if (ranges[i].setting)
681
static const se_f_def_t defs[] = {
682
- { "revert", js_control_revert, 0, 0, SE_GROUP_HIDDEN, NULL, NULL },
683
- { "reset", js_control_reset, 0, 0, SE_GROUP_HIDDEN, NULL, NULL },
684
+ { "revert", js_control_revert, 0, JSFUN_FAST_NATIVE, SE_GROUP_HIDDEN, NULL, NULL },
685
+ { "reset", js_control_reset, 0, JSFUN_FAST_NATIVE, SE_GROUP_HIDDEN, NULL, NULL },
689
--- gxine-0.5.905.orig/src/player.c
690
+++ gxine-0.5.905/src/player.c
691
@@ -302,6 +302,7 @@ void player_stop (void)
694
pthread_cancel (thread);
695
+ gtk_video_in_spu_button (gtv, 0);
699
@@ -405,37 +406,36 @@ static void update_postproc_chain (const
702
static JSBool set_postproc_chain (const char *func, const char *pref,
703
- JSContext *cx, JSObject *obj,
704
- uintN argc, jsval *argv, jsval *rval)
705
+ JSContext *cx, uintN argc, jsval *vp)
707
+ jsval *argv = JS_ARGV (cx, vp);
708
se_log_fncall (func);
709
se_argc_check (1, func);
710
se_arg_is_string (0, func);
711
- update_postproc_chain (pref,
712
- JS_GetStringBytes (JS_ValueToString (cx, argv[0])));
713
+ char *value = SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[0]));
714
+ update_postproc_chain (pref, value);
715
+ SE_JS_FREE_ENCODED_STRING(cx, value);
716
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
721
-static JSBool set_vo_postproc_chain (JSContext *cx, JSObject *obj,
722
- uintN argc, jsval *argv, jsval *rval)
723
+static JSBool set_vo_postproc_chain (JSContext *cx, uintN argc, jsval *vp)
725
return set_postproc_chain ("vo_postproc.set_chain", "gui.post_plugins.video",
726
- cx, obj, argc, argv, rval);
730
-static JSBool set_deint_postproc_chain (JSContext *cx, JSObject *obj,
731
- uintN argc, jsval *argv, jsval *rval)
732
+static JSBool set_deint_postproc_chain (JSContext *cx, uintN argc, jsval *vp)
734
return set_postproc_chain ("vo_deinterlace.set_chain", "gui.post_plugins.deinterlace",
735
- cx, obj, argc, argv, rval);
739
-static JSBool set_ao_postproc_chain (JSContext *cx, JSObject *obj,
740
- uintN argc, jsval *argv, jsval *rval)
741
+static JSBool set_ao_postproc_chain (JSContext *cx, uintN argc, jsval *vp)
743
return set_postproc_chain ("ao_postproc.set_chain", "gui.post_plugins.audio",
744
- cx, obj, argc, argv, rval);
748
static int listen_postproc_chain (void *pref, se_t *se, se_o_t *obj,
749
@@ -445,89 +445,82 @@ static int listen_postproc_chain (void *
753
-static JSBool get_time (JSContext *cx, JSObject *obj, uintN argc,
754
- jsval *argv, jsval *rval)
755
+static JSBool get_time (JSContext *cx, uintN argc, jsval *vp)
757
int pos, pos_time, len;
758
se_log_fncall ("get_time");
759
xine_get_pos_length (stream, &pos, &pos_time, &len);
760
- *rval = INT_TO_JSVAL (pos_time);
761
+ JS_SET_RVAL (cx, vp, INT_TO_JSVAL (pos_time));
765
-static JSBool get_pos (JSContext *cx, JSObject *obj, uintN argc,
766
- jsval *argv, jsval *rval)
767
+static JSBool get_pos (JSContext *cx, uintN argc, jsval *vp)
769
int pos, pos_time, len;
770
se_log_fncall ("get_pos");
771
xine_get_pos_length (stream, &pos, &pos_time, &len);
773
- jsdouble *pos_percent = JS_NewDouble (cx, pos / 655.35);
774
- *rval = DOUBLE_TO_JSVAL (pos_percent);
775
+ jsval rval = JS_RVAL (cx, vp);
776
+ SE_JS_NEW_NUMBER_VAL (cx, pos / 655.35, rval);
780
-static JSBool has_time (JSContext *cx, JSObject *obj, uintN argc,
781
- jsval *argv, jsval *rval)
782
+static JSBool has_time (JSContext *cx, uintN argc, jsval *vp)
784
int pos, pos_time, len;
785
se_log_fncall ("has_time");
786
xine_get_pos_length (stream, &pos, &pos_time, &len);
787
- *rval = BOOLEAN_TO_JSVAL (len != 0);
788
+ JS_SET_RVAL (cx, vp, BOOLEAN_TO_JSVAL (len != 0));
794
-static JSBool js_get_speed (JSContext *cx, JSObject *obj, uintN argc,
795
- jsval *argv, jsval *rval)
796
+static JSBool js_get_speed (JSContext *cx, uintN argc, jsval *vp)
798
se_prop_read_t speed;
799
se_log_fncall_obsolete ("get_speed");
800
get_speed (NULL, &speed);
801
- *rval = INT_TO_JSVAL (speed.i);
802
+ JS_SET_RVAL (cx, vp, INT_TO_JSVAL (speed.i));
806
-static JSBool js_get_volume (JSContext *cx, JSObject *obj, uintN argc,
807
- jsval *argv, jsval *rval)
808
+static JSBool js_get_volume (JSContext *cx, uintN argc, jsval *vp)
810
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
812
se_log_fncall_obsolete ("get_volume");
813
volume = xine_get_param (stream, XINE_PARAM_AUDIO_VOLUME);
814
- *rval = INT_TO_JSVAL (volume);
815
+ JS_SET_RVAL (cx, vp, INT_TO_JSVAL (volume));
819
-static JSBool js_get_mute (JSContext *cx, JSObject *obj, uintN argc,
820
- jsval *argv, jsval *rval)
821
+static JSBool js_get_mute (JSContext *cx, uintN argc, jsval *vp)
823
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
825
se_log_fncall_obsolete ("get_mute");
826
mute = xine_get_param (stream, XINE_PARAM_AUDIO_MUTE);
827
- *rval = BOOLEAN_TO_JSVAL (mute);
828
+ JS_SET_RVAL (cx, vp, BOOLEAN_TO_JSVAL (mute));
832
-static JSBool js_get_zoom (JSContext *cx, JSObject *obj, uintN argc,
833
- jsval *argv, jsval *rval)
834
+static JSBool js_get_zoom (JSContext *cx, uintN argc, jsval *vp)
836
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
838
se_log_fncall_obsolete ("get_zoom");
839
zoom = xine_get_param (stream, XINE_PARAM_VO_ZOOM_X);
840
- *rval = INT_TO_JSVAL (zoom);
841
+ JS_SET_RVAL (cx, vp, INT_TO_JSVAL (zoom));
845
#endif /* WITH_OBSOLETE */
847
-static JSBool controls_pause (JSContext *cx, JSObject *obj, uintN argc,
848
- jsval *argv, jsval *rval)
849
+static JSBool controls_pause (JSContext *cx, uintN argc, jsval *vp)
851
int32 pause_state=-1;
852
+ jsval *argv = JS_ARGV (cx, vp);
854
se_log_fncall_checkinit ("pause");
855
se_argc_check_max (1, "pause");
856
@@ -553,21 +546,21 @@ static JSBool controls_pause (JSContext
857
set_speed (XINE_SPEED_NORMAL);
860
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
864
-static JSBool controls_stop (JSContext *cx, JSObject *obj, uintN argc,
865
- jsval *argv, jsval *rval)
866
+static JSBool controls_stop (JSContext *cx, uintN argc, jsval *vp)
868
se_log_fncall_checkinit ("stop");
870
playlist_logo (NULL);
871
ui_set_control_adjustment (Control_SEEKER, 0);
872
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
876
-static JSBool controls_eject (JSContext *cx, JSObject *obj, uintN argc,
877
- jsval *argv, jsval *rval)
878
+static JSBool controls_eject (JSContext *cx, uintN argc, jsval *vp)
880
se_log_fncall_checkinit ("eject");
881
if (xine_get_status (stream) == XINE_STATUS_PLAY)
882
@@ -576,17 +569,18 @@ static JSBool controls_eject (JSContext
883
playlist_logo (cx); /* doesn't matter so long as it's not NULL */
884
gdk_threads_enter ();
885
ui_set_control_adjustment (Control_SEEKER, 0);
886
+ gtk_video_in_spu_button (gtv, 0);
887
int ret = xine_eject (stream);
888
- *rval = BOOLEAN_TO_JSVAL (ret);
889
+ JS_SET_RVAL (cx, vp, BOOLEAN_TO_JSVAL (ret));
895
-static JSBool js_set_speed (JSContext *cx, JSObject *obj, uintN argc,
896
- jsval *argv, jsval *rval)
897
+static JSBool js_set_speed (JSContext *cx, uintN argc, jsval *vp)
900
+ jsval *argv = JS_ARGV (cx, vp);
902
se_log_fncall_obsolete ("set_speed");
904
@@ -599,13 +593,14 @@ static JSBool js_set_speed (JSContext *c
906
set_speed (calc_speed (speed));
908
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
912
-static JSBool js_set_volume (JSContext *cx, JSObject *obj, uintN argc,
913
- jsval *argv, jsval *rval)
914
+static JSBool js_set_volume (JSContext *cx, uintN argc, jsval *vp)
917
+ jsval *argv = JS_ARGV (cx, vp);
919
se_log_fncall_obsolete ("set_volume");
920
se_argc_check (1, "set_volume");
921
@@ -618,13 +613,14 @@ static JSBool js_set_volume (JSContext *
922
ui_set_control_adjustment (Control_VOLUME, volume);
923
ui_xine_set_param_from_adjustment (Control_VOLUME);
925
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
929
-static JSBool js_set_mute (JSContext *cx, JSObject *obj, uintN argc,
930
- jsval *argv, jsval *rval)
931
+static JSBool js_set_mute (JSContext *cx, uintN argc, jsval *vp)
934
+ jsval *argv = JS_ARGV (cx, vp);
936
se_log_fncall_obsolete ("set_mute");
937
se_argc_check_max (1, "set_mute");
938
@@ -639,13 +635,14 @@ static JSBool js_set_mute (JSContext *cx
942
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
946
-static JSBool js_set_zoom (JSContext *cx, JSObject *obj, uintN argc,
947
- jsval *argv, jsval *rval)
948
+static JSBool js_set_zoom (JSContext *cx, uintN argc, jsval *vp)
951
+ jsval *argv = JS_ARGV (cx, vp);
953
se_log_fncall_obsolete ("set_zoom");
954
se_argc_check (1, "set_zoom");
955
@@ -654,6 +651,7 @@ static JSBool js_set_zoom (JSContext *cx
956
JS_ValueToInt32 (cx, argv[0], &zoom);
959
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
963
@@ -684,9 +682,9 @@ static gboolean set_video_size_cb (gpoin
967
-static JSBool js_set_video_size (JSContext *cx, JSObject *obj, uintN argc,
968
- jsval *argv, jsval *rval)
969
+static JSBool js_set_video_size (JSContext *cx, uintN argc, jsval *vp)
971
+ jsval *argv = JS_ARGV (cx, vp);
972
se_log_fncall ("set_video_size");
973
se_argc_check (1, "set_video_size");
974
se_arg_is_int (0, "set_video_size");
975
@@ -704,15 +702,16 @@ static JSBool js_set_video_size (JSConte
976
g_source_remove (zoomcb_id);
977
zoomcb_id = g_idle_add ((GSourceFunc) set_video_size_cb, NULL);
979
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
983
#ifdef WITH_DEPRECATED
985
-static JSBool js_set_fullscreen (JSContext *cx, JSObject *obj, uintN argc,
986
- jsval *argv, jsval *rval)
987
+static JSBool js_set_fullscreen (JSContext *cx, uintN argc, jsval *vp)
990
+ jsval *argv = JS_ARGV (cx, vp);
992
se_log_fncall_deprecated ("set_fullscreen");
993
se_argc_check_max (1, "set_fullscreen");
994
@@ -728,15 +727,16 @@ static JSBool js_set_fullscreen (JSConte
995
if (gtk_toggle_action_get_active (action_items.fullscreen) != fs)
996
gtk_action_activate (GTK_ACTION (action_items.fullscreen));
998
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1002
#ifdef WITH_OBSOLETE
1004
-static JSBool js_set_deinterlace (JSContext *cx, JSObject *obj, uintN argc,
1005
- jsval *argv, jsval *rval)
1006
+static JSBool js_set_deinterlace (JSContext *cx, uintN argc, jsval *vp)
1009
+ jsval *argv = JS_ARGV (cx, vp);
1011
se_log_fncall_obsolete ("set_deinterlace");
1012
se_argc_check_max (1, "set_deinterlace");
1013
@@ -750,14 +750,15 @@ static JSBool js_set_deinterlace (JSCont
1014
di = !gtk_video_get_use_post_plugins_deinterlace ((GtkVideo *)gtv);
1016
set_deinterlace (di);
1017
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1021
-static JSBool js_set_postproc_video (JSContext *cx, JSObject *obj,
1022
- uintN argc, jsval *argv, jsval *rval)
1023
+static JSBool js_set_postproc_video (JSContext *cx, uintN argc, jsval *vp)
1025
se_t *se = (se_t *) JS_GetContextPrivate(cx);
1027
+ jsval *argv = JS_ARGV (cx, vp);
1029
se_log_fncall_obsolete ("set_postproc_video");
1030
se_argc_check_max (1, "set_postproc_video");
1031
@@ -767,26 +768,28 @@ static JSBool js_set_postproc_video (JSC
1032
if (JSVAL_IS_INT (argv[0]))
1033
JS_ValueToInt32 (cx, argv[0], &di);
1034
else if (JSVAL_IS_STRING (argv[0]))
1035
- return set_vo_postproc_chain (cx, obj, argc, argv, rval);
1036
+ return set_vo_postproc_chain (cx, argc, vp);
1039
se->print_cb (se->print_cb_data,
1040
_("error: %s() argument %d is neither int nor string\n"),
1041
"set_postproc_video", 1);
1042
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1046
di = !gtk_video_get_use_post_plugins_video ((GtkVideo *)gtv);
1048
set_vo_postproc (di);
1049
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1053
-static JSBool js_set_postproc_audio (JSContext *cx, JSObject *obj,
1054
- uintN argc, jsval *argv, jsval *rval)
1055
+static JSBool js_set_postproc_audio (JSContext *cx, uintN argc, jsval *vp)
1057
se_t *se = (se_t *) JS_GetContextPrivate(cx);
1059
+ jsval *argv = JS_ARGV (cx, vp);
1061
se_log_fncall_obsolete ("set_postproc_audio");
1062
se_argc_check_max (1, "set_postproc_audio");
1063
@@ -796,25 +799,27 @@ static JSBool js_set_postproc_audio (JSC
1064
if (JSVAL_IS_INT (argv[0]))
1065
JS_ValueToInt32 (cx, argv[0], &di);
1066
else if (JSVAL_IS_STRING (argv[0]))
1067
- return set_ao_postproc_chain (cx, obj, argc, argv, rval);
1068
+ return set_ao_postproc_chain (cx, argc, vp);
1071
se->print_cb (se->print_cb_data,
1072
_("error: %s() argument %d is neither int nor string\n"),
1073
"set_postproc_audio", 1);
1074
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1078
di = !gtk_video_get_use_post_plugins_audio ((GtkVideo *)gtv);
1080
set_ao_postproc (di);
1081
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1085
-static JSBool js_set_auto_resize (JSContext *cx, JSObject *obj, uintN argc,
1086
- jsval *argv, jsval *rval)
1087
+static JSBool js_set_auto_resize (JSContext *cx, uintN argc, jsval *vp)
1090
+ jsval *argv = JS_ARGV (cx, vp);
1092
se_log_fncall_obsolete ("set_auto_resize");
1093
se_argc_check_max (1, "set_auto_resize");
1094
@@ -828,13 +833,14 @@ static JSBool js_set_auto_resize (JSCont
1095
ar = !gtk_video_get_auto_resize ((GtkVideo *)gtv);
1097
set_auto_resize (ar);
1098
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1102
-static JSBool js_set_auto_rescale (JSContext *cx, JSObject *obj, uintN argc,
1103
- jsval *argv, jsval *rval)
1104
+static JSBool js_set_auto_rescale (JSContext *cx, uintN argc, jsval *vp)
1107
+ jsval *argv = JS_ARGV (cx, vp);
1109
se_log_fncall_obsolete ("set_auto_rescale");
1110
se_argc_check_max (1, "set_auto_rescale");
1111
@@ -848,13 +854,14 @@ static JSBool js_set_auto_rescale (JSCon
1112
ar = !gtk_video_get_auto_rescale ((GtkVideo *)gtv);
1114
set_auto_rescale (ar);
1115
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1119
-static JSBool js_set_aspect (JSContext *cx, JSObject *obj, uintN argc,
1120
- jsval *argv, jsval *rval)
1121
+static JSBool js_set_aspect (JSContext *cx, uintN argc, jsval *vp)
1124
+ jsval *argv = JS_ARGV (cx, vp);
1126
se_log_fncall_obsolete ("set_aspect");
1127
se_argc_check_max (1, "set_aspect");
1128
@@ -868,18 +875,19 @@ static JSBool js_set_aspect (JSContext *
1129
aspect = xine_get_param (stream, XINE_PARAM_VO_ASPECT_RATIO) + 1;
1131
set_aspect (aspect);
1132
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1136
#endif /* WITH_OBSOLETE */
1137
#endif /* WITH_DEPRECATED */
1139
-static JSBool js_snapshot (JSContext *cx, JSObject *obj, uintN argc,
1140
- jsval *argv, jsval *rval)
1141
+static JSBool js_snapshot (JSContext *cx, uintN argc, jsval *vp)
1145
int32 scale = -1, blend = -1;
1146
+ jsval *argv = JS_ARGV (cx, vp);
1148
se_log_fncall_checkinit ("snapshot");
1149
se_argc_check_range (0, 3, "snapshot");
1150
@@ -895,18 +903,20 @@ static JSBool js_snapshot (JSContext *cx
1152
se_arg_is_string (0, "snapshot");
1153
str = JS_ValueToString (cx, argv[0]);
1154
- fname = JS_GetStringBytes (str);
1155
+ fname = SE_JS_ENCODE_STRING (cx, str);
1158
make_snapshot (fname, scale, blend);
1160
+ SE_JS_FREE_ENCODED_STRING (cx, fname);
1161
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1166
-static JSBool controls_play (JSContext *cx, JSObject *obj, uintN argc,
1167
- jsval *argv, jsval *rval)
1168
+static JSBool controls_play (JSContext *cx, uintN argc, jsval *vp)
1170
+ jsval *argv = JS_ARGV (cx, vp);
1171
se_log_fncall_checkinit ("play");
1172
se_argc_check_max (3, "play");
1174
@@ -925,7 +935,7 @@ static JSBool controls_play (JSContext *
1176
str = JS_ValueToString (cx, argv[0]);
1178
- mrl = JS_GetStringBytes (str);
1179
+ mrl = SE_JS_ENCODE_STRING (cx, str);
1180
se_log ("playing '%s' from start\n", mrl);
1183
@@ -935,9 +945,10 @@ static JSBool controls_play (JSContext *
1184
se_arg_is_number (0, "play");
1185
se_arg_is_int (1, "play");
1187
- jsdouble *posv = JS_NewDouble (cx, 0); /* when is this freed? */
1188
- JS_ValueToNumber (cx, argv[0], posv);
1189
- pos = (*posv >= 0 && *posv < 100) ? *posv * 655.35 : -1;
1191
+ JS_ValueToNumber (cx, argv[0], &posv);
1192
+ pos = (posv >= 0 && posv < 100) ? posv * 655.35 : -1;
1194
JS_ValueToInt32 (cx, argv[1], &pos_time);
1196
se_log ("playing from %d, %d\n", pos, pos_time);
1197
@@ -951,18 +962,23 @@ static JSBool controls_play (JSContext *
1198
se_arg_is_int (2, "play");
1200
JSString *str = JS_ValueToString (cx, argv[0]);
1201
- jsdouble *posv = JS_NewDouble (cx, 0); /* when is this freed? */
1202
- JS_ValueToNumber (cx, argv[1], posv);
1203
- pos = (*posv >= 0 && *posv < 100) ? *posv * 655.35 : -1;
1206
+ JS_ValueToNumber (cx, argv[1], &posv);
1207
+ pos = (posv >= 0 && posv < 100) ? posv * 655.35 : -1;
1209
JS_ValueToInt32 (cx, argv[2], &pos_time);
1210
- mrl = JS_GetStringBytes (str);
1211
+ mrl = SE_JS_ENCODE_STRING (cx, str);
1212
se_log ("playing '%s' from %d, %d\n", mrl, pos, pos_time);
1219
playlist_play_from (playlist_add_mrl (mrl, -1), pos, pos_time);
1220
+ SE_JS_FREE_ENCODED_STRING (cx, mrl);
1224
play_item_t *item = playlist_get_current_item ();
1225
@@ -990,15 +1006,16 @@ static JSBool controls_play (JSContext *
1227
set_speed (XINE_SPEED_NORMAL);
1229
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1233
/* Crude hack to allow combined play/pause function.
1234
* (Useful on some keyboards with CD/DVD control keys.)
1236
-static JSBool controls_play_pause (JSContext *cx, JSObject *obj, uintN argc,
1237
- jsval *argv, jsval *rval)
1238
+static JSBool controls_play_pause (JSContext *cx, uintN argc, jsval *vp)
1240
+ jsval *argv = JS_ARGV (cx, vp);
1241
se_log_fncall_checkinit ("play_pause");
1242
se_argc_check_max (1, "play_pause");
1244
@@ -1009,22 +1026,21 @@ static JSBool controls_play_pause (JSCon
1246
case XINE_STATUS_STOP:
1247
case XINE_STATUS_IDLE:
1248
- return controls_play (cx, obj, 0, 0, rval);
1249
+ return controls_play (cx, argc, vp);
1251
- return controls_pause (cx, obj, argc, argv, rval);
1252
+ return controls_pause (cx, argc, vp);
1256
-static JSBool js_is_live_stream (JSContext *cx, JSObject *obj, uintN argc,
1257
- jsval *argv, jsval *rval)
1258
+static JSBool js_is_live_stream (JSContext *cx, uintN argc, jsval *vp)
1260
- *rval = JSVAL_FALSE;
1261
+ JS_SET_RVAL(cx, vp, JSVAL_FALSE);
1263
se_log_fncall ("is_live_stream");
1264
se_argc_check_max (0, "is_live_stream");
1266
if (player_live_stream ())
1267
- *rval = JSVAL_TRUE;
1268
+ JS_SET_RVAL (cx, vp, JSVAL_TRUE);
1272
@@ -1087,12 +1103,11 @@ static xine_audio_port_t *load_audio_out
1275
static void add_chain_funcs (const char *prop, const char *config,
1276
- JSBool (*set_chain) (JSContext *, JSObject *,
1277
- uintN, jsval *, jsval *))
1278
+ JSBool (*set_chain) (JSContext *, uintN, jsval *))
1280
se_o_t *obj = se_find_object (gse, NULL, prop);
1282
- se_defun (gse, obj, "set_chain", set_chain, 0, 0, SE_GROUP_HIDDEN, NULL, NULL);
1283
+ se_defun (gse, obj, "set_chain", set_chain, 0, JSFUN_FAST_NATIVE, SE_GROUP_HIDDEN, NULL, NULL);
1284
se_prop_create_xine_id (gse, obj, "chain", config);
1285
se_prop_add_listener (gse, obj, "chain",
1286
listen_postproc_chain, (void *)config);
1287
@@ -1194,69 +1209,69 @@ void player_init (void)
1290
static const se_f_def_t defs[] = {
1291
- { "play", controls_play, 0, 0,
1292
+ { "play", controls_play, 0, JSFUN_FAST_NATIVE,
1293
/* help text describes function parameters */
1294
SE_GROUP_ENGINE, N_("[mrl] [, pos, time]"),
1295
N_("time in milliseconds") },
1296
- { "get_time", get_time, 0, 0,
1297
+ { "get_time", get_time, 0, JSFUN_FAST_NATIVE,
1298
SE_GROUP_ENGINE, NULL, N_("stream time index") },
1299
- { "get_pos", get_pos, 0, 0,
1300
+ { "get_pos", get_pos, 0, JSFUN_FAST_NATIVE,
1301
SE_GROUP_ENGINE, NULL, N_("stream position (%)") },
1302
- { "has_time", has_time, 0, 0,
1303
+ { "has_time", has_time, 0, JSFUN_FAST_NATIVE,
1304
SE_GROUP_ENGINE, NULL, N_("whether the stream has a time index") },
1305
- { "pause", controls_pause, 0, 0,
1306
+ { "pause", controls_pause, 0, JSFUN_FAST_NATIVE,
1307
SE_GROUP_ENGINE, N_("[bool]"), NULL },
1308
- { "stop", controls_stop, 0, 0,
1309
+ { "stop", controls_stop, 0, JSFUN_FAST_NATIVE,
1310
SE_GROUP_ENGINE, NULL, NULL },
1311
- { "eject", controls_eject, 0, 0,
1312
+ { "eject", controls_eject, 0, JSFUN_FAST_NATIVE,
1313
SE_GROUP_ENGINE, NULL, NULL },
1314
- { "play_pause", controls_play_pause, 0, 0,
1315
+ { "play_pause", controls_play_pause, 0, JSFUN_FAST_NATIVE,
1316
SE_GROUP_ENGINE, N_("[bool]"), NULL },
1317
- { "snapshot", js_snapshot, 0, 0,
1318
+ { "snapshot", js_snapshot, 0, JSFUN_FAST_NATIVE,
1319
/* these correspond to the options in the snapshot-save dialogue box */
1320
SE_GROUP_ENGINE, N_("[file name [, scale, blend]]"), NULL },
1322
- { "set_video_size", js_set_video_size, 0, 0,
1323
+ { "set_video_size", js_set_video_size, 0, JSFUN_FAST_NATIVE,
1324
SE_GROUP_PROPERTIES, N_("int"), NULL },
1326
#ifdef WITH_DEPRECATED
1327
#ifdef WITH_OBSOLETE
1328
- { "set_speed", js_set_speed, 0, 0,
1329
+ { "set_speed", js_set_speed, 0, JSFUN_FAST_NATIVE,
1330
SE_GROUP_HIDDEN, NULL, NULL },
1331
- { "get_speed", js_get_speed, 0, 0,
1332
+ { "get_speed", js_get_speed, 0, JSFUN_FAST_NATIVE,
1333
SE_GROUP_HIDDEN, NULL, NULL },
1334
- { "set_volume", js_set_volume, 0, 0,
1335
+ { "set_volume", js_set_volume, 0, JSFUN_FAST_NATIVE,
1336
SE_GROUP_HIDDEN, NULL, NULL },
1337
- { "get_volume", js_get_volume, 0, 0,
1338
+ { "get_volume", js_get_volume, 0, JSFUN_FAST_NATIVE,
1339
SE_GROUP_HIDDEN, NULL, NULL },
1340
- { "set_mute", js_set_mute, 0, 0,
1341
+ { "set_mute", js_set_mute, 0, JSFUN_FAST_NATIVE,
1342
SE_GROUP_HIDDEN, NULL, NULL },
1343
- { "get_mute", js_get_mute, 0, 0,
1344
+ { "get_mute", js_get_mute, 0, JSFUN_FAST_NATIVE,
1345
SE_GROUP_HIDDEN, NULL, NULL },
1346
- { "set_zoom", js_set_zoom, 0, 0,
1347
+ { "set_zoom", js_set_zoom, 0, JSFUN_FAST_NATIVE,
1348
SE_GROUP_HIDDEN, NULL, NULL },
1349
- { "get_zoom", js_get_zoom, 0, 0,
1350
+ { "get_zoom", js_get_zoom, 0, JSFUN_FAST_NATIVE,
1351
SE_GROUP_HIDDEN, NULL, NULL },
1352
#endif /* WITH_OBSOLETE */
1353
- { "set_fullscreen", js_set_fullscreen, 0, 0,
1354
+ { "set_fullscreen", js_set_fullscreen, 0, JSFUN_FAST_NATIVE,
1355
SE_GROUP_HIDDEN, NULL, NULL },
1356
#ifdef WITH_OBSOLETE
1357
- { "set_aspect", js_set_aspect, 0, 0,
1358
+ { "set_aspect", js_set_aspect, 0, JSFUN_FAST_NATIVE,
1359
SE_GROUP_HIDDEN, NULL, NULL },
1360
- { "set_deinterlace", js_set_deinterlace, 0, 0,
1361
+ { "set_deinterlace", js_set_deinterlace, 0, JSFUN_FAST_NATIVE,
1362
SE_GROUP_HIDDEN, NULL, NULL },
1363
- { "set_postproc_video", js_set_postproc_video, 0, 0,
1364
+ { "set_postproc_video", js_set_postproc_video, 0, JSFUN_FAST_NATIVE,
1365
SE_GROUP_HIDDEN, NULL, NULL },
1366
- { "set_postproc_audio", js_set_postproc_audio, 0, 0,
1367
+ { "set_postproc_audio", js_set_postproc_audio, 0, JSFUN_FAST_NATIVE,
1368
SE_GROUP_HIDDEN, NULL, NULL },
1369
- { "set_auto_resize", js_set_auto_resize, 0, 0,
1370
+ { "set_auto_resize", js_set_auto_resize, 0, JSFUN_FAST_NATIVE,
1371
SE_GROUP_HIDDEN, NULL, NULL },
1372
- { "set_auto_rescale", js_set_auto_rescale, 0, 0,
1373
+ { "set_auto_rescale", js_set_auto_rescale, 0, JSFUN_FAST_NATIVE,
1374
SE_GROUP_HIDDEN, NULL, NULL },
1375
#endif /* WITH_OBSOLETE */
1376
#endif /* WITH_DEPRECATED */
1378
- { "is_live_stream", js_is_live_stream, 0, 0,
1379
+ { "is_live_stream", js_is_live_stream, 0, JSFUN_FAST_NATIVE,
1380
SE_GROUP_PROPERTIES, NULL, NULL },
1383
--- gxine-0.5.905.orig/src/wizards.c
1384
+++ gxine-0.5.905/src/wizards.c
1385
@@ -414,17 +414,17 @@ void run_wizards (gboolean requested)
1389
-static JSBool js_run_wizards (JSContext *cx, JSObject *obj, uintN argc,
1390
- jsval *argv, jsval *rval)
1391
+static JSBool js_run_wizards (JSContext *cx, uintN argc, jsval *vp)
1393
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
1394
se_log_fncall_checkinit ("run_wizards");
1396
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1400
void wizards_init (void)
1402
- se_defun (gse, NULL, "run_wizards", js_run_wizards, 0, 0,
1403
+ se_defun (gse, NULL, "run_wizards", js_run_wizards, 0, JSFUN_FAST_NATIVE,
1404
SE_GROUP_HIDDEN, NULL, NULL);
1406
--- gxine-0.5.905.orig/src/open_mrl.c
1407
+++ gxine-0.5.905/src/open_mrl.c
1408
@@ -88,21 +88,21 @@ static void open_mrl_response_cb (GtkDia
1412
-static JSBool js_open_show (JSContext *cx, JSObject *obj, uintN argc,
1413
- jsval *argv, jsval *rval)
1414
+static JSBool js_open_show (JSContext *cx, uintN argc, jsval *vp)
1416
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
1417
se_log_fncall_checkinit ("open_show");
1418
file_dialog_show ();
1419
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1423
-static JSBool js_open_mrl_show (JSContext *cx, JSObject *obj, uintN argc,
1424
- jsval *argv, jsval *rval)
1425
+static JSBool js_open_mrl_show (JSContext *cx, uintN argc, jsval *vp)
1427
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
1428
se_log_fncall_checkinit ("open_mrl_show");
1430
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1434
@@ -142,8 +142,8 @@ void open_mrl_init (void)
1437
static const se_f_def_t defs[] = {
1438
- { "open_show", js_open_show, 0, 0, SE_GROUP_FILE, NULL, NULL },
1439
- { "open_mrl_show", js_open_mrl_show, 0, 0, SE_GROUP_FILE, NULL, NULL },
1440
+ { "open_show", js_open_show, 0, JSFUN_FAST_NATIVE, SE_GROUP_FILE, NULL, NULL },
1441
+ { "open_mrl_show", js_open_mrl_show, 0, JSFUN_FAST_NATIVE, SE_GROUP_FILE, NULL, NULL },
1444
se_defuns (gse, NULL, defs);
1445
--- gxine-0.5.905.orig/src/key_events.c
1446
+++ gxine-0.5.905/src/key_events.c
1447
@@ -1041,10 +1041,13 @@ static JSBool js_xine_event (int type
1450
#define JS_XINE_EVENT(L,T) \
1451
- static JSBool js_##L (JSContext *cx, JSObject *obj, uintN argc, \
1452
- jsval *argv, jsval *rval) \
1453
+ static JSBool js_##L (JSContext *cx, uintN argc, jsval *vp) \
1455
- return js_xine_event (XINE_EVENT_##T, #L); \
1456
+ JSBool ret = js_xine_event (XINE_EVENT_##T, #L); \
1458
+ JS_SET_RVAL (cx, vp, JSVAL_VOID); \
1463
JS_XINE_EVENT (input_up, INPUT_UP);
1464
@@ -1091,16 +1094,15 @@ JS_XINE_EVENT (input_menu3, INPUT_MENU3)
1465
JS_XINE_EVENT (input_previous, INPUT_PREVIOUS);
1466
JS_XINE_EVENT (input_next, INPUT_NEXT);
1468
-static JSBool js_keybindings_show (JSContext *cx, JSObject *obj, uintN argc,
1469
- jsval *argv, jsval *rval)
1470
+static JSBool js_keybindings_show (JSContext *cx, uintN argc, jsval *vp)
1472
se_log_fncall_checkinit ("keybindings_show");
1474
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1478
-static JSBool js_keypad_show (JSContext *cx, JSObject *obj, uintN argc,
1479
- jsval *argv, jsval *rval)
1480
+static JSBool js_keypad_show (JSContext *cx, uintN argc, jsval *vp)
1482
se_log_fncall_checkinit ("keypad_show");
1484
@@ -1110,6 +1112,7 @@ static JSBool js_keypad_show (JSContext
1486
window_show (keypad, NULL);
1488
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1492
@@ -1247,8 +1250,8 @@ static const kb_xine_event_map_t xine_vd
1496
-JSBool js_event_generic (JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
1497
- jsval *rval, const char *func, const char *const *prefix,
1498
+JSBool js_event_generic (JSContext *cx, uintN argc, jsval *vp,
1499
+ const char *func, const char *const *prefix,
1502
se_t *se = (se_t *) JS_GetContextPrivate(cx);
1503
@@ -1257,8 +1260,9 @@ JSBool js_event_generic (JSContext *cx,
1506
const kb_xine_event_map_t *evlist;
1507
+ jsval *argv = JS_ARGV (cx, vp);
1509
- *rval = JSVAL_TRUE;
1510
+ JS_SET_RVAL (cx, vp, JSVAL_TRUE);
1512
se_log_fncall (func);
1513
se_argc_check_max (1, func);
1514
@@ -1275,7 +1279,7 @@ JSBool js_event_generic (JSContext *cx,
1516
se_arg_is_string (0, func);
1518
- *rval = JSVAL_FALSE;
1519
+ JS_SET_RVAL (cx, vp, JSVAL_FALSE);
1523
@@ -1294,7 +1298,7 @@ JSBool js_event_generic (JSContext *cx,
1526
str = JS_ValueToString (cx, argv[0]);
1527
- evstr = JS_GetStringBytes (str);
1528
+ evstr = SE_JS_ENCODE_STRING (cx, str);
1531
va_start (ap, prefix);
1532
@@ -1306,8 +1310,10 @@ JSBool js_event_generic (JSContext *cx,
1533
event.type = kb_xine_event_lookup (NULL, evstr);
1537
+ SE_JS_FREE_ENCODED_STRING (cx, evstr);
1541
if (event.type != -1)
1544
@@ -1316,21 +1322,20 @@ JSBool js_event_generic (JSContext *cx,
1545
xine_event_send (stream, &event);
1548
- *rval = JSVAL_TRUE;
1549
+ SE_JS_FREE_ENCODED_STRING (cx, evstr);
1550
+ JS_SET_RVAL (cx, vp, JSVAL_TRUE);
1554
-static JSBool js_event (JSContext *cx, JSObject *obj, uintN argc,
1555
- jsval *argv, jsval *rval)
1556
+static JSBool js_event (JSContext *cx, uintN argc, jsval *vp)
1558
- return js_event_generic (cx, obj, argc, argv, rval, "event", NULL, NULL);
1559
+ return js_event_generic (cx, argc, vp, "event", NULL, NULL);
1562
-static JSBool js_vdr (JSContext *cx, JSObject *obj, uintN argc,
1563
- jsval *argv, jsval *rval)
1564
+static JSBool js_vdr (JSContext *cx, uintN argc, jsval *vp)
1566
const char *const prefixes[] = { "vdr:/", "netvdr:/", NULL };
1567
- return js_event_generic (cx, obj, argc, argv, rval, "vdr", prefixes,
1568
+ return js_event_generic (cx, argc, vp, "vdr", prefixes,
1572
@@ -1528,25 +1533,25 @@ void key_events_init (void)
1575
static const se_f_def_t defs[] = {
1576
- { "input_up", js_input_up, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1577
- { "input_down", js_input_down, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1578
- { "input_left", js_input_left, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1579
- { "input_right", js_input_right, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1580
- { "input_select", js_input_select, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1581
- { "input_menu", js_input_menu, 0, 0,
1582
+ { "input_up", js_input_up, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1583
+ { "input_down", js_input_down, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1584
+ { "input_left", js_input_left, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1585
+ { "input_right", js_input_right, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1586
+ { "input_select", js_input_select, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1587
+ { "input_menu", js_input_menu, 0, JSFUN_FAST_NATIVE,
1588
SE_GROUP_INPUT, N_("int"), N_("range is 1 to 7") },
1589
- { "input_menu1", js_input_menu1, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1590
- { "input_menu2", js_input_menu2, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1591
- { "input_menu3", js_input_menu3, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1592
- { "input_previous", js_input_previous, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1593
- { "input_next", js_input_next, 0, 0, SE_GROUP_INPUT, NULL, NULL },
1594
- { "keybindings_show", js_keybindings_show, 0, 0,
1595
+ { "input_menu1", js_input_menu1, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1596
+ { "input_menu2", js_input_menu2, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1597
+ { "input_menu3", js_input_menu3, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1598
+ { "input_previous", js_input_previous, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1599
+ { "input_next", js_input_next, 0, JSFUN_FAST_NATIVE, SE_GROUP_INPUT, NULL, NULL },
1600
+ { "keybindings_show", js_keybindings_show, 0, JSFUN_FAST_NATIVE,
1601
SE_GROUP_DIALOGUE, NULL, NULL },
1602
- { "keypad_show", js_keypad_show, 0, 0,
1603
+ { "keypad_show", js_keypad_show, 0, JSFUN_FAST_NATIVE,
1604
SE_GROUP_DIALOGUE, NULL, NULL },
1605
- { "event", js_event, 0, 0,
1606
+ { "event", js_event, 0, JSFUN_FAST_NATIVE,
1607
SE_GROUP_INPUT, N_("string"), N_("event; returns true if sent") },
1608
- { "vdr", js_vdr, 0, 0,
1609
+ { "vdr", js_vdr, 0, JSFUN_FAST_NATIVE,
1610
SE_GROUP_EXTERNAL, N_("string"), N_("VDR event; returns true if sent") },
1613
--- gxine-0.5.905.orig/src/preferences.c
1614
+++ gxine-0.5.905/src/preferences.c
1615
@@ -1106,12 +1106,12 @@ static void response_cb (GtkDialog *dbox
1619
-static JSBool js_preferences_show (JSContext *cx, JSObject *obj, uintN argc,
1620
- jsval *argv, jsval *rval)
1621
+static JSBool js_preferences_show (JSContext *cx, uintN argc, jsval *vp)
1623
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
1624
se_log_fncall_checkinit ("preferences_show");
1625
preferences_show ();
1626
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1630
@@ -1171,7 +1171,7 @@ void preferences_init (void)
1633
/* script engine functions */
1634
- se_defun (gse, NULL, "preferences_show", js_preferences_show, 0, 0,
1635
+ se_defun (gse, NULL, "preferences_show", js_preferences_show, 0, JSFUN_FAST_NATIVE,
1636
SE_GROUP_DIALOGUE, NULL, NULL);
1638
preferences_init_dbox ();
1639
--- gxine-0.5.905.orig/src/lirc.c
1640
+++ gxine-0.5.905/src/lirc.c
1641
@@ -212,8 +212,7 @@ void gxine_lirc_quit (void)
1645
-static JSBool js_reload_lirc (JSContext *cx, JSObject *obj, uintN argc,
1646
- jsval *argv, jsval *rval)
1647
+static JSBool js_reload_lirc (JSContext *cx, uintN argc, jsval *vp)
1649
se_log_fncall ("reload_lirc");
1650
se_argc_check_max (0, "reload_lirc");
1651
@@ -221,13 +220,13 @@ static JSBool js_reload_lirc (JSContext
1652
if (gxine_lirc_thread)
1653
pthread_join (gxine_lirc_thread, NULL);
1654
gxine_lirc_start ();
1655
- *rval = gxine_lirc_thread ? JSVAL_TRUE : JSVAL_FALSE;
1656
+ JS_SET_RVAL (cx, vp, gxine_lirc_thread ? JSVAL_TRUE : JSVAL_FALSE);
1660
void gxine_lirc_init (void)
1662
- se_defun (gse, NULL, "reload_lirc", js_reload_lirc, 0, 0,
1663
+ se_defun (gse, NULL, "reload_lirc", js_reload_lirc, 0, JSFUN_FAST_NATIVE,
1664
SE_GROUP_HIDDEN, NULL, NULL);
1665
gxine_lirc_start ();
1667
--- gxine-0.5.905.orig/src/script_engine.h
1668
+++ gxine-0.5.905/src/script_engine.h
1671
#include <pthread.h>
1673
+#ifndef JSFUN_FAST_NATIVE
1674
+// All natives are JSFastNative
1675
+#define JSFUN_FAST_NATIVE 0
1678
+#ifdef HAVE_JS_GET_STRING_BYTES
1679
+# define SE_JS_ENCODE_STRING(cx, str) JS_GetStringBytes(str)
1680
+# define SE_JS_FREE_ENCODED_STRING(cx, str)
1682
+# define SE_JS_ENCODE_STRING(cx, str) JS_EncodeString(cx, str)
1683
+# define SE_JS_FREE_ENCODED_STRING(cx, str) JS_free(cx, str)
1686
+#ifdef HAVE_JS_NEW_DOUBLE
1687
+# define SE_JS_NEW_NUMBER_VAL(cx, d, rval) \
1688
+ jsdouble *new_d = JS_NewDouble (cx, d); \
1689
+ rval = DOUBLE_TO_JSVAL (new_d)
1691
+# define SE_JS_NEW_NUMBER_VAL(cx, d, rval) \
1692
+ JS_NewNumberValue (cx, d, &rval)
1695
+#ifdef JS_PROPERTY_OP_HAS_ID_AS_JSID
1696
+# define SE_JS_PROPERTY_GETTER_DECLARE(name) \
1698
+ name(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
1699
+# define SE_JS_PROPERTY_GETTER_INIT_VARIABLES(idval) \
1701
+ JS_IdToValue (cx, id, &idval)
1702
+# define SE_JS_CALL_PROPERTY_GETTER_WITH_JSVAL(getter, cx, obj, propval, vp) __extension__ ({ \
1704
+ JS_ValueToId (cx, propval, &propid); \
1705
+ JSBool ret = getter (cx, obj, propid, vp); \
1709
+# define SE_JS_PROPERTY_GETTER_DECLARE(name) \
1711
+ name(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
1712
+# define SE_JS_PROPERTY_GETTER_INIT_VARIABLES(idval) \
1714
+# define SE_JS_CALL_PROPERTY_GETTER_WITH_JSVAL(getter, cx, obj, propval, vp) __extension__ ({ \
1715
+ JSBool ret = getter (cx, obj, propval, vp); \
1720
+#ifdef HAVE_JS_STRICT_PROPERTY_OP
1721
+# define SE_JS_PROPERTY_SETTER_DECLARE(name) \
1723
+ name(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
1724
+# define SE_JS_PROPERTY_SETTER_INIT_VARIABLES(idval) \
1726
+ JS_IdToValue (cx, id, &idval)
1727
+# define SE_JS_CALL_PROPERTY_SETTER_WITH_JSVAL(setter, cx, obj, propval, vp) __extension__ ({ \
1729
+ JS_ValueToId (cx, propval, &propid); \
1730
+ JSBool ret = setter (cx, obj, propid, JS_FALSE, vp); \
1733
+#elif JS_PROPERTY_OP_HAS_ID_AS_JSID
1734
+# define SE_JS_PROPERTY_SETTER_DECLARE(name) \
1736
+ name(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
1737
+# define SE_JS_PROPERTY_SETTER_INIT_VARIABLES(idval) \
1739
+ JS_IdToValue (cx, id, &idval)
1740
+# define SE_JS_CALL_PROPERTY_SETTER_WITH_JSVAL(setter, cx, obj, propval, vp) __extension__ ({ \
1742
+ JS_ValueToId (cx, propval, &propid); \
1743
+ JSBool ret = setter (cx, obj, propid, vp); \
1747
+# define SE_JS_PROPERTY_SETTER_DECLARE(name) \
1749
+ name(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
1750
+# define SE_JS_PROPERTY_SETTER_INIT_VARIABLES(idval) \
1752
+# define SE_JS_CALL_PROPERTY_SETTER_WITH_JSVAL(setter, cx, obj, propval, vp) __extension__ ({ \
1753
+ JSBool ret = setter (cx, obj, propval, vp); \
1758
+#ifdef JSVAL_TO_DOUBLE_RETURNS_POINTER
1759
+# define SE_JSVAL_TO_DOUBLE(v) *JSVAL_TO_DOUBLE(v)
1761
+# define SE_JSVAL_TO_DOUBLE(v) JSVAL_TO_DOUBLE(v)
1764
typedef int (*se_prop_int_cb_t) (void *user_data, char *property, int *num);
1765
typedef void (*se_print_cb_t) (void *user_data, const char *str, ...)
1766
__attribute__ ((format (printf, 2, 3)));
1767
--- gxine-0.5.905.orig/src/systray.c
1768
+++ gxine-0.5.905/src/systray.c
1769
@@ -214,10 +214,10 @@ button_cb (GtkWidget *widget, GdkEventBu
1773
-static JSBool js_minimise (JSContext *cx, JSObject *obj, uintN argc,
1774
- jsval *argv, jsval *rval)
1775
+static JSBool js_minimise (JSContext *cx, uintN argc, jsval *vp)
1777
int32 tray_state=-1;
1778
+ jsval *argv = JS_ARGV (cx, vp);
1780
se_log_fncall_checkinit ("set_minimised");
1781
se_argc_check_max (1, "set_minimised");
1782
@@ -239,13 +239,14 @@ static JSBool js_minimise (JSContext *cx
1786
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1790
void systray_init (void)
1792
static const se_f_def_t defs[] = {
1793
- { "set_minimised", js_minimise, 0, 0,
1794
+ { "set_minimised", js_minimise, 0, JSFUN_FAST_NATIVE,
1795
SE_GROUP_ENGINE, N_("[bool]"),
1796
N_("true to hide, false to show") },
1798
--- gxine-0.5.905.orig/src/settings.c
1799
+++ gxine-0.5.905/src/settings.c
1800
@@ -129,10 +129,10 @@ get_sliders (const struct slider_window_
1803
#define JSFUNC(OBJ,FUNC) \
1804
- static JSBool js_##OBJ##_##FUNC (JSContext *cx, JSObject *obj, uintN argc, \
1805
- jsval *argv, jsval *rval) \
1806
+ static JSBool js_##OBJ##_##FUNC (JSContext *cx, uintN argc, jsval *vp) \
1809
+ jsval *argv = JS_ARGV (cx, vp); \
1810
se_log_fncall_checkinit (#OBJ"_"#FUNC); \
1811
se_argc_check_max (1, #OBJ"_"#FUNC); \
1813
@@ -141,11 +141,14 @@ get_sliders (const struct slider_window_
1814
JS_ValueToInt32 (cx, argv[0], &page); \
1816
sliders_##FUNC (&OBJ##_window, page, TRUE); \
1818
+ JS_SET_RVAL (cx, vp, JSVAL_VOID); \
1823
#define JSDECL(OBJ,FUNC) \
1824
- { #OBJ"_"#FUNC, js_##OBJ##_##FUNC, 0, 0,SE_GROUP_DIALOGUE, NULL, NULL }
1825
+ { #OBJ"_"#FUNC, js_##OBJ##_##FUNC, 0, JSFUN_FAST_NATIVE,SE_GROUP_DIALOGUE, NULL, NULL }
1827
static void sliders_show (struct slider_window_s *window, guint page,
1829
@@ -331,5 +334,5 @@ void settings_init (void)
1831
void settings_clear (void)
1833
- js_settings_clear (gse->cx, NULL, 0, NULL, NULL);
1834
+ js_settings_clear (gse->cx, 0, NULL);
1836
--- gxine-0.5.905.orig/src/post.c
1837
+++ gxine-0.5.905/src/post.c
1838
@@ -1079,38 +1079,47 @@ post_config_post_chain_window (gxine_cha
1842
-js_deinterlace_show (JSContext *cx, JSObject *obj, uintN argc,
1843
- jsval *argv, jsval *rval)
1844
+js_deinterlace_show (JSContext *cx, uintN argc, jsval *vp)
1846
se_log_fncall_checkinit ("deinterlace_show");
1847
- return post_config_post_chain_window (&chains[POST_CHAIN_DEINTERLACE]);
1848
+ JSBool ret = post_config_post_chain_window (&chains[POST_CHAIN_DEINTERLACE]);
1850
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1856
-js_pp_video_show (JSContext *cx, JSObject *obj, uintN argc,
1857
- jsval *argv, jsval *rval)
1858
+js_pp_video_show (JSContext *cx, uintN argc, jsval *vp)
1860
se_log_fncall_checkinit ("postproc_video_show");
1861
- return post_config_post_chain_window (&chains[POST_CHAIN_VIDEO]);
1862
+ JSBool ret = post_config_post_chain_window (&chains[POST_CHAIN_VIDEO]);
1864
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1870
-js_pp_audio_show (JSContext *cx, JSObject *obj, uintN argc,
1871
- jsval *argv, jsval *rval)
1872
+js_pp_audio_show (JSContext *cx, uintN argc, jsval *vp)
1874
se_log_fncall_checkinit ("postproc_audio_show");
1875
- return post_config_post_chain_window (&chains[POST_CHAIN_AUDIO]);
1876
+ JSBool ret = post_config_post_chain_window (&chains[POST_CHAIN_AUDIO]);
1878
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1886
static const se_f_def_t defs[] = {
1887
- { "deinterlace_show", js_deinterlace_show, 0, 0,
1888
+ { "deinterlace_show", js_deinterlace_show, 0, JSFUN_FAST_NATIVE,
1889
SE_GROUP_DIALOGUE, NULL, NULL },
1890
- { "postproc_video_show", js_pp_video_show, 0, 0,
1891
+ { "postproc_video_show", js_pp_video_show, 0, JSFUN_FAST_NATIVE,
1892
SE_GROUP_DIALOGUE, NULL, NULL },
1893
- { "postproc_audio_show", js_pp_audio_show, 0, 0,
1894
+ { "postproc_audio_show", js_pp_audio_show, 0, JSFUN_FAST_NATIVE,
1895
SE_GROUP_DIALOGUE, NULL, NULL },
1898
--- gxine-0.5.905.orig/src/playlist.c
1899
+++ gxine-0.5.905/src/playlist.c
1900
@@ -2123,71 +2123,70 @@ static void drop_cb (GtkTreeView *widget
1904
-static JSBool js_playlist_get_item (JSContext *cx, JSObject *obj, uintN argc,
1905
- jsval *argv, jsval *rval)
1906
+static JSBool js_playlist_get_item (JSContext *cx, uintN argc, jsval *vp)
1908
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
1909
se_log_fncall ("playlist_get_item");
1910
- *rval = INT_TO_JSVAL (playlist_get_list_pos());
1911
+ JS_SET_RVAL (cx, vp, INT_TO_JSVAL (playlist_get_list_pos()));
1915
-static JSBool js_playlist_clear (JSContext *cx, JSObject *obj, uintN argc,
1916
- jsval *argv, jsval *rval)
1917
+static JSBool js_playlist_clear (JSContext *cx, uintN argc, jsval *vp)
1919
se_log_fncall_checkinit ("playlist_clear");
1921
- *rval = JSVAL_VOID;
1922
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1926
-static JSBool js_playlist_flush (JSContext *cx, JSObject *obj, uintN argc,
1927
- jsval *argv, jsval *rval)
1928
+static JSBool js_playlist_flush (JSContext *cx, uintN argc, jsval *vp)
1930
se_log_fncall_checkinit ("playlist_flush");
1931
playlist_flush (PLAY_ITEM_NORMAL);
1932
- *rval = JSVAL_VOID;
1933
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1937
-static JSBool js_playlist_load (JSContext *cx, JSObject *obj, uintN argc,
1938
- jsval *argv, jsval *rval)
1939
+static JSBool js_playlist_load (JSContext *cx, uintN argc, jsval *vp)
1941
+ jsval *argv = JS_ARGV (cx, vp);
1942
se_log_fncall_checkinit ("playlist_load");
1944
se_argc_check (1, "playlist_load");
1945
se_arg_is_string_or_null (0, "playlist_load");
1947
- char *mrl = JS_GetStringBytes (JS_ValueToString (cx, argv[0]));
1948
+ char *mrl = SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[0]));
1950
logprintf ("playlist_load: file=%s\n", mrl);
1951
playlist_load_any (mrl);
1953
- *rval = JSVAL_VOID;
1954
+ SE_JS_FREE_ENCODED_STRING (cx, mrl);
1955
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
1959
-static JSBool js_playlist_add (JSContext *cx, JSObject *obj, uintN argc,
1960
- jsval *argv, jsval *rval)
1961
+static JSBool js_playlist_add (JSContext *cx, uintN argc, jsval *vp)
1963
+ jsval *argv = JS_ARGV (cx, vp);
1965
se_log_fncall_checkinit ("playlist_add");
1967
se_argc_check_range (1, 2, "playlist_add");
1968
se_arg_is_string (0, "playlist_add");
1970
- char *mrl = JS_GetStringBytes (JS_ValueToString (cx, argv[0]));
1971
+ char *mrl = SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[0]));
1976
se_arg_is_string_or_null (1, "playlist_add");
1977
char *title = JSVAL_IS_STRING (argv[1])
1978
- ? JS_GetStringBytes (JS_ValueToString (cx, argv[1]))
1979
+ ? SE_JS_ENCODE_STRING (cx, JS_ValueToString (cx, argv[1]))
1981
logprintf ("playlist_add: MRL=%s title=%s\n", mrl, title);
1982
play_item_t *play_item = play_item_new (title, mrl, 0, 0);
1983
item = playlist_add (play_item, -1);
1984
+ SE_JS_FREE_ENCODED_STRING (cx, title);
1988
@@ -2195,14 +2194,15 @@ static JSBool js_playlist_add (JSContext
1989
item = playlist_add_mrl (mrl, -1);
1992
- *rval = INT_TO_JSVAL (item);
1993
+ SE_JS_FREE_ENCODED_STRING (cx, mrl);
1994
+ JS_SET_RVAL (cx, vp, INT_TO_JSVAL (item));
1999
-static JSBool js_playlist_delete (JSContext *cx, JSObject *obj, uintN argc,
2000
- jsval *argv, jsval *rval)
2001
+static JSBool js_playlist_delete (JSContext *cx, uintN argc, jsval *vp)
2003
+ jsval *argv = JS_ARGV (cx, vp);
2004
se_log_fncall_checkinit ("playlist_remove");
2006
se_argc_check_range (1, 2, "playlist_remove");
2007
@@ -2227,14 +2227,14 @@ static JSBool js_playlist_delete (JSCont
2008
gtk_list_store_remove (pl_store, &iter);
2011
- *rval = JSVAL_VOID;
2012
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2016
-static JSBool js_playlist_play (JSContext *cx, JSObject *obj, uintN argc,
2017
- jsval *argv, jsval *rval)
2018
+static JSBool js_playlist_play (JSContext *cx, uintN argc, jsval *vp)
2021
+ jsval *argv = JS_ARGV (cx, vp);
2023
se_log_fncall_checkinit ("playlist_play");
2025
@@ -2245,21 +2245,19 @@ static JSBool js_playlist_play (JSContex
2027
playlist_play (item);
2029
- *rval = JSVAL_VOID;
2030
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2034
-static JSBool js_playlist_show (JSContext *cx, JSObject *obj, uintN argc,
2035
- jsval *argv, jsval *rval)
2036
+static JSBool js_playlist_show (JSContext *cx, uintN argc, jsval *vp)
2038
se_log_fncall_checkinit ("playlist_show");
2040
- *rval = JSVAL_VOID;
2041
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2045
-static JSBool js_mrl_browser_refresh (JSContext *cx, JSObject *obj, uintN argc,
2046
- jsval *argv, jsval *rval)
2047
+static JSBool js_mrl_browser_refresh (JSContext *cx, uintN argc, jsval *vp)
2050
se_log_fncall_checkinit ("mrl_browser_refresh");
2051
@@ -2270,14 +2268,14 @@ static JSBool js_mrl_browser_refresh (JS
2052
|| !item_marked_current (&iter))
2054
playlist_flush (PLAY_ITEM_BROWSER);
2055
- *rval = JSVAL_VOID;
2056
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2061
playlist_browse_set (cur_item ? : playlist_get_item (cur_list_pos));
2063
- *rval = JSVAL_VOID;
2064
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2068
@@ -2604,23 +2602,23 @@ void playlist_init (void)
2071
static const se_f_def_t defs[] = {
2072
- { "playlist_show", js_playlist_show, 0, 0,
2073
+ { "playlist_show", js_playlist_show, 0, JSFUN_FAST_NATIVE,
2074
SE_GROUP_DIALOGUE, NULL, NULL },
2075
- { "playlist_clear", js_playlist_clear, 0, 0,
2076
+ { "playlist_clear", js_playlist_clear, 0, JSFUN_FAST_NATIVE,
2077
SE_GROUP_PLAYLIST, NULL, NULL },
2078
- { "playlist_flush", js_playlist_flush, 0, 0,
2079
+ { "playlist_flush", js_playlist_flush, 0, JSFUN_FAST_NATIVE,
2080
SE_GROUP_PLAYLIST, NULL, NULL },
2081
- { "playlist_load", js_playlist_load, 0, 0,
2082
+ { "playlist_load", js_playlist_load, 0, JSFUN_FAST_NATIVE,
2083
SE_GROUP_PLAYLIST, N_("file"), NULL },
2084
- { "playlist_add", js_playlist_add, 0, 0,
2085
+ { "playlist_add", js_playlist_add, 0, JSFUN_FAST_NATIVE,
2086
SE_GROUP_PLAYLIST, N_("MRL[, title]"), NULL },
2087
- { "playlist_delete", js_playlist_delete, 0, 0,
2088
+ { "playlist_delete", js_playlist_delete, 0, JSFUN_FAST_NATIVE,
2089
SE_GROUP_PLAYLIST, N_("int"), NULL },
2090
- { "playlist_play", js_playlist_play, 0, 0,
2091
+ { "playlist_play", js_playlist_play, 0, JSFUN_FAST_NATIVE,
2092
SE_GROUP_PLAYLIST, N_("int"), N_("playlist entry number") },
2093
- { "playlist_get_item", js_playlist_get_item, 0, 0,
2094
+ { "playlist_get_item", js_playlist_get_item, 0, JSFUN_FAST_NATIVE,
2095
SE_GROUP_PLAYLIST, NULL, NULL },
2096
- { "mrl_browser_refresh", js_mrl_browser_refresh, 0, 0,
2097
+ { "mrl_browser_refresh", js_mrl_browser_refresh, 0, JSFUN_FAST_NATIVE,
2098
SE_GROUP_HIDDEN, NULL, NULL },
2101
--- gxine-0.5.905.orig/src/key_events.h
2102
+++ gxine-0.5.905/src/key_events.h
2103
@@ -52,8 +52,7 @@ void save_key_bindings (void);
2104
/* returns xine event number (XINE_EVENT_*) or 0 on failure */
2105
int kb_xine_event_lookup (const kb_xine_event_map_t *, const char *);
2107
-JSBool js_event_generic (JSContext *, JSObject *, uintN argc, jsval *argv,
2108
- jsval *rval, const char *func,
2109
+JSBool js_event_generic (JSContext *, uintN argc, jsval *vp, const char *func,
2110
const char *const *mrlprefix, ...)
2111
__attribute__ ((sentinel));
2113
--- gxine-0.5.905.orig/src/xml_widgets.c
2114
+++ gxine-0.5.905/src/xml_widgets.c
2115
@@ -186,13 +186,13 @@ stock_toggle_cb (GtkToggleButton *button
2116
ui_set_status (UI_CURRENT_STATE);
2119
-#define JS_WIDGET() ((se_o_t *)JS_GetPrivate (cx, obj))->user_data
2120
+#define JS_WIDGET() ((se_o_t *)JS_GetPrivate (cx, JS_THIS_OBJECT (cx, vp)))->user_data
2123
-js_set_show (JSContext *cx, JSObject *obj,
2124
- uintN argc, jsval *argv, jsval *rval)
2125
+js_set_show (JSContext *cx, uintN argc, jsval *vp)
2128
+ jsval *argv = JS_ARGV (cx, vp);
2129
se_log_fncall ("<widget>.set_show");
2130
se_argc_check_range (1, 2, "<widget>.set_show");
2131
se_arg_is_int_or_bool (0, "<widget>.set_show");
2132
@@ -210,28 +210,30 @@ js_set_show (JSContext *cx, JSObject *ob
2133
gtk_widget_show (JS_WIDGET ());
2135
gtk_widget_hide (JS_WIDGET ());
2136
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2141
-js_set_sensitive (JSContext *cx, JSObject *obj,
2142
- uintN argc, jsval *argv, jsval *rval)
2143
+js_set_sensitive (JSContext *cx, uintN argc, jsval *vp)
2146
+ jsval *argv = JS_ARGV (cx, vp);
2147
se_log_fncall ("<widget>.set_sensitive");
2148
se_argc_check (1, "<widget>.set_sensitive");
2149
se_arg_is_int_or_bool (0, "<widget>.set_sensitive");
2150
JS_ValueToBoolean (cx, argv[0], &v);
2151
gtk_widget_set_sensitive (JS_WIDGET (), v);
2152
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2157
-js_activate (JSContext *cx, JSObject *obj,
2158
- uintN argc, jsval *argv, jsval *rval)
2159
+js_activate (JSContext *cx, uintN argc, jsval *vp)
2161
se_log_fncall ("<widget>.activate");
2162
gtk_widget_activate (JS_WIDGET ());
2163
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2167
@@ -1257,9 +1259,9 @@ widget_parse (xml_node_t *node)
2169
char *se_name, *se_dot;
2170
static const se_f_def_t defs[] = {
2171
- { "set_show", js_set_show, 0, 0, SE_GROUP_HIDDEN, NULL, NULL },
2172
- { "set_sensitive", js_set_sensitive, 0, 0, SE_GROUP_HIDDEN, NULL, NULL },
2173
- { "activate", js_activate, 0, 0, SE_GROUP_HIDDEN, NULL, NULL },
2174
+ { "set_show", js_set_show, 0, JSFUN_FAST_NATIVE, SE_GROUP_HIDDEN, NULL, NULL },
2175
+ { "set_sensitive", js_set_sensitive, 0, JSFUN_FAST_NATIVE, SE_GROUP_HIDDEN, NULL, NULL },
2176
+ { "activate", js_activate, 0, JSFUN_FAST_NATIVE, SE_GROUP_HIDDEN, NULL, NULL },
2179
if (!se_widget_space)
2180
--- gxine-0.5.905.orig/src/mediamarks.c
2181
+++ gxine-0.5.905/src/mediamarks.c
2182
@@ -680,30 +680,30 @@ void mm_save (void)
2186
-static JSBool js_mm_add_show (JSContext *cx, JSObject *obj, uintN argc,
2187
- jsval *argv, jsval *rval)
2188
+static JSBool js_mm_add_show (JSContext *cx, uintN argc, jsval *vp)
2190
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
2191
se_log_fncall_checkinit ("mm_add_show");
2193
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2197
-static JSBool js_mm_manage_show (JSContext *cx, JSObject *obj, uintN argc,
2198
- jsval *argv, jsval *rval)
2199
+static JSBool js_mm_manage_show (JSContext *cx, uintN argc, jsval *vp)
2201
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
2202
se_log_fncall_checkinit ("mm_manage_show");
2204
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2208
-static JSBool js_import_mediamarks (JSContext *cx, JSObject *obj, uintN argc,
2209
- jsval *argv, jsval *rval)
2210
+static JSBool js_import_mediamarks (JSContext *cx, uintN argc, jsval *vp)
2212
/* se_t *se = (se_t *) JS_GetContextPrivate(cx); */
2213
se_log_fncall_checkinit ("import_mediamarks");
2215
+ JS_SET_RVAL (cx, vp, JSVAL_VOID);
2219
@@ -950,11 +950,11 @@ void mediamarks_init (void)
2222
static const se_f_def_t defs[] = {
2223
- { "mm_add_show", js_mm_add_show, 0, 0,
2224
+ { "mm_add_show", js_mm_add_show, 0, JSFUN_FAST_NATIVE,
2225
SE_GROUP_DIALOGUE, NULL, NULL },
2226
- { "mm_manage_show", js_mm_manage_show, 0, 0,
2227
+ { "mm_manage_show", js_mm_manage_show, 0, JSFUN_FAST_NATIVE,
2228
SE_GROUP_DIALOGUE, NULL, NULL },
2229
- { "import_mediamarks", js_import_mediamarks, 0, 0,
2230
+ { "import_mediamarks", js_import_mediamarks, 0, JSFUN_FAST_NATIVE,
2231
SE_GROUP_FILE, NULL, NULL },
2234
--- gxine-0.5.905.orig/src/engine.c
2235
+++ gxine-0.5.905/src/engine.c
29
--- gxine-0.5.907.orig/src/script_engine.c
30
+++ gxine-0.5.907/src/script_engine.c
31
@@ -855,6 +855,7 @@ SE_JS_PROPERTY_SETTER_DECLARE(generic_JS
33
if (!SE_JS_CALL_PROPERTY_SETTER_WITH_JSVAL (generic_JSSetProperty, cx, p->obj, dot, vp))
34
*vp = OBJECT_TO_JSVAL (p->obj);
35
+ SE_JS_FREE_ENCODED_STRING (cx, prop);
39
--- gxine-0.5.907.orig/src/engine.c
40
+++ gxine-0.5.907/src/engine.c
2236
41
@@ -30,7 +30,7 @@
2237
42
#include <errno.h>
2238
43
#include <unistd.h>