Changeset d2c8e211e8b9b0b1ca1df362816bfd520920406c

Show
Ignore:
Timestamp:
12/09/05 14:29:09 (3 years ago)
Author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr>
git-committer:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1134134949 +0000
git-parent:

[b7e834c2032b31dd4d717c05737e992ab878f50d]

git-author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1134134949 +0000
Message:

python/vlcglue.c: Allow that start, stop, pause, resume methods can take no parameter.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bindings/python/vlcglue.c

    rb7e834c rd2c8e21  
    4949    PyPosition_Type.tp_new = PyType_GenericNew; 
    5050    PyPosition_Type.tp_alloc = PyType_GenericAlloc; 
    51  
    52         /*  PyEval_InitThreads(); */ 
    53  
    54         /* Have a look at 
    55 http://base.bel-epa.com/pyapache/Python/MySQL-python/MySQL-python-0.3.0/_mysqlmodule.c */ 
    5651 
    5752    m = Py_InitModule3( "vlc", vlc_methods, 
     
    854849 
    855850    if( !PyArg_ParseTuple(args, "O", &py_pos ) ) 
    856         return NULL; 
    857  
     851    { 
     852        /* No argument. Use a default 0 value. */ 
     853        PyErr_Clear(); 
     854        py_pos = NULL; 
     855    } 
    858856    a_position = position_py_to_c(py_pos); 
    859857    if ( !a_position ) 
     
    878876 
    879877    if( !PyArg_ParseTuple(args, "O", &py_pos ) ) 
     878    { 
     879        /* No argument. Use a default 0 value. */ 
     880        PyErr_Clear(); 
     881        py_pos = NULL; 
     882    } 
     883    a_position = position_py_to_c(py_pos); 
     884    if ( !a_position ) 
    880885        return NULL; 
    881  
    882     a_position = position_py_to_c(py_pos); 
    883886 
    884887    Py_BEGIN_ALLOW_THREADS 
     
    900903 
    901904    if( !PyArg_ParseTuple(args, "O", &py_pos ) ) 
     905    { 
     906        /* No argument. Use a default 0 value. */ 
     907        PyErr_Clear(); 
     908        py_pos = NULL; 
     909    } 
     910    a_position = position_py_to_c(py_pos); 
     911    if ( !a_position ) 
    902912        return NULL; 
    903  
    904     a_position = position_py_to_c(py_pos); 
    905913 
    906914    Py_BEGIN_ALLOW_THREADS 
     
    922930 
    923931    if( !PyArg_ParseTuple(args, "O", &py_pos ) ) 
     932    { 
     933        /* No argument. Use a default 0 value. */ 
     934        PyErr_Clear(); 
     935        py_pos = NULL; 
     936    } 
     937    a_position = position_py_to_c(py_pos); 
     938    if ( !a_position ) 
    924939        return NULL; 
    925  
    926     a_position = position_py_to_c(py_pos); 
    927940 
    928941    Py_BEGIN_ALLOW_THREADS 
     
    13111324    } 
    13121325 
    1313     if (PyObject_IsInstance(py_position, (PyObject*)&PyPosition_Type)) 
     1326    if (! py_position) 
     1327    { 
     1328        /* If we give a NULL value, it will be considered as 
     1329           a 0 relative position in mediatime */ 
     1330        a_position->origin = mediacontrol_RelativePosition; 
     1331        a_position->key    = mediacontrol_MediaTime; 
     1332        a_position->value  = 0; 
     1333    } 
     1334    else if (PyObject_IsInstance(py_position, (PyObject*)&PyPosition_Type)) 
    13141335    { 
    13151336        a_position->origin = pos->origin;