~ubuntu-branches/ubuntu/wily/mediatomb/wily-proposed

« back to all changes in this revision

Viewing changes to src/scripting/playlist_parser_script.cc

  • Committer: Package Import Robot
  • Author(s): Steve Langasek
  • Date: 2015-08-12 15:51:30 UTC
  • mfrom: (4.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20150812155130-54v3y5zta9oyuejg
Tags: 0.12.1-47-g7ab7616-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/control:
    + Don't build-depend on libmozjs-dev.
  - debian/{mediatomb-daemon.mediatomb.upstart,rules}: Introduce upstart
    support to fix start-on-boot failure.
  - debian/rules: Disable JS support.
* Dropped changes:
  - drop OR depends on abrowser, which last existed in precise.
  - debian/mediatomb-daemon.postinst: no reason this needs an executable
    bit in the source package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
26
    
27
 
    $Id: playlist_parser_script.cc 2081 2010-03-23 20:18:00Z lww $
 
27
    $Id$
28
28
*/
29
29
 
30
30
/// \file playlist_parser_script.cc
46
46
extern "C" {
47
47
 
48
48
static JSBool
49
 
js_readln(JSContext *cx, uintN argc, jsval *argv)
 
49
js_readln(JSContext *cx, uintN argc, jsval *vp)
50
50
{
51
 
    PlaylistParserScript *self = (PlaylistParserScript *)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, argv));
 
51
    PlaylistParserScript *self = (PlaylistParserScript *)JS_GetContextPrivate(cx);
52
52
 
53
53
    String line;
54
54
    
69
69
 
70
70
    JSString *jsline = JS_NewStringCopyZ(cx, line.c_str());
71
71
 
72
 
    JS_SET_RVAL(cx, argv, STRING_TO_JSVAL(jsline));
 
72
    JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(jsline));
73
73
  
74
74
    return JS_TRUE;
75
75
}
93
93
 
94
94
        String scriptPath = ConfigManager::getInstance()->getOption(CFG_IMPORT_SCRIPTING_PLAYLIST_SCRIPT); 
95
95
        load(scriptPath);
96
 
        root = JS_NewObject(cx, NULL, script, NULL);
97
 
        JS_AddNamedObjectRoot(cx, &root, "PlaylistScript");
 
96
        JS_AddNamedObjectRoot(cx, &script, "PlaylistScript");
98
97
    }
99
98
    catch (Exception ex)
100
99
    {
244
243
    JS_BeginRequest(cx);
245
244
#endif
246
245
 
247
 
    if (root)
248
 
        JS_RemoveObjectRoot(cx, &root);
 
246
    if (script)
 
247
        JS_RemoveObjectRoot(cx, &script);
249
248
 
250
249
#ifdef JS_THREADSAFE
251
250
    JS_EndRequest(cx);