]> git.sesse.net Git - vlc/commitdiff
* compilation fixes...
authorCyril Deguet <asmax@videolan.org>
Wed, 26 Feb 2003 21:00:53 +0000 (21:00 +0000)
committerCyril Deguet <asmax@videolan.org>
Wed, 26 Feb 2003 21:00:53 +0000 (21:00 +0000)
python/vlcmodule.c
python/vlrs/announce.py
python/vlrs/streamer.py

index 87494112b7e76432db11caa367985e121dee4b2b..70b08c758a352a479217a0b01d930919b43e8cf5 100644 (file)
@@ -17,15 +17,25 @@ static PyObject *vlc_create(PyObject *self, PyObject *args)
 static PyObject *vlc_init(PyObject *self, PyObject *args)
 {
     int iVlc;
-    char *file;
     char *pArgv[] = { "vlc", "--sout", NULL };
     int iRc;
 
-    if (!PyArg_ParseTuple(args, "iss", &iVlc, &file, &pArgv[2]))
+    if (!PyArg_ParseTuple(args, "iss", &iVlc, &pArgv[2]))
         return NULL;
     iRc = VLC_Init(iVlc, 3, pArgv);
-    if (iRc >= 0)
-        iRc = VLC_AddTarget(iVlc, file, PLAYLIST_APPEND, PLAYLIST_END);
+    return Py_BuildValue("i", iRc);
+}
+
+
+static PyObject *vlc_addTarget(PyObject *self, PyObject *args)
+{
+    int iVlc;
+    char *file;
+    int iRc;
+
+    if (!PyArg_ParseTuple(args, "is", &iVlc, &file))
+        return NULL;
+    iRc = VLC_AddTarget(iVlc, file, PLAYLIST_APPEND, PLAYLIST_END);
     return Py_BuildValue("i", iRc);
 }
 
@@ -69,6 +79,7 @@ static PyObject *vlc_pause(PyObject *self, PyObject *args)
 static PyMethodDef VlcMethods[] = {
     {"create", vlc_create, METH_VARARGS, "Create a vlc thread."},
     {"init", vlc_init, METH_VARARGS, "Initialize a vlc thread."},
+    {"addTarget", vlc_addTarget, METH_VARARGS, "Add a target in the playlist."},
     {"play", vlc_play, METH_VARARGS, "Play"},
     {"stop", vlc_stop, METH_VARARGS, "Stop"},
     {"pause", vlc_pause, METH_VARARGS, "Pause"},
index 4608ce3fb26d4de332989bb23850529d1f4cbf3f..771bf2bebe275a310b0605a42d1e2c717f180489 100644 (file)
@@ -25,3 +25,7 @@ class AnnounceList:
     def addMulticastSession(self, session):
         "Add a multicast session in the announce list"
         self.multicastList[session.id] = session
+        
+    def delMulticastSession(self, session):
+        "Delete a multicast session from the announce list"
+        del self.multicastList[session.id]
index 23551a1acae5e982c1a5b62c7bb26ff1c74f3ec8..216df85b23a79cc7369e7c1682cada7ea33321d5 100755 (executable)
@@ -23,7 +23,9 @@ class VlcStreamer:
         self.id = vlc.create()
         if self.id < 0:        
             raise VlcError
-        if vlc.init(self.id, self.file, self.address) < 0:
+        if vlc.init(self.id, self.address) < 0:
+            raise VlcError
+        if vlc.addTarget(self.id, self.file) < 0:
             raise VlcError
             
     def play(self):