Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
b7e834c2
Commit
b7e834c2
authored
Dec 09, 2005
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python/vlcglue.c: exception-related code fixes
parent
3d26787a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
41 deletions
+26
-41
bindings/python/vlcglue.c
bindings/python/vlcglue.c
+26
-41
No files found.
bindings/python/vlcglue.c
View file @
b7e834c2
...
@@ -49,6 +49,17 @@ vlcMODINIT_FUNC initvlc(void)
...
@@ -49,6 +49,17 @@ vlcMODINIT_FUNC initvlc(void)
PyPosition_Type
.
tp_new
=
PyType_GenericNew
;
PyPosition_Type
.
tp_new
=
PyType_GenericNew
;
PyPosition_Type
.
tp_alloc
=
PyType_GenericAlloc
;
PyPosition_Type
.
tp_alloc
=
PyType_GenericAlloc
;
/* PyEval_InitThreads(); */
/* Have a look at
http://base.bel-epa.com/pyapache/Python/MySQL-python/MySQL-python-0.3.0/_mysqlmodule.c */
m
=
Py_InitModule3
(
"vlc"
,
vlc_methods
,
"VLC media player embedding module."
);
if
(
!
m
)
return
;
if
(
PyType_Ready
(
&
PyPosition_Type
)
<
0
)
if
(
PyType_Ready
(
&
PyPosition_Type
)
<
0
)
return
;
return
;
if
(
PyType_Ready
(
&
MediaControl_Type
)
<
0
)
if
(
PyType_Ready
(
&
MediaControl_Type
)
<
0
)
...
@@ -58,42 +69,41 @@ vlcMODINIT_FUNC initvlc(void)
...
@@ -58,42 +69,41 @@ vlcMODINIT_FUNC initvlc(void)
return
;
return
;
#endif
#endif
/* PyEval_InitThreads(); */
/* Have a look at
http://base.bel-epa.com/pyapache/Python/MySQL-python/MySQL-python-0.3.0/_mysqlmodule.c */
m
=
Py_InitModule3
(
"vlc"
,
vlc_methods
,
"VLC media player embedding module."
);
/* Exceptions */
/* Exceptions */
MediaControl_InternalException
=
MediaControl_InternalException
=
PyErr_NewException
(
"vlc.InternalException"
,
NULL
,
NULL
);
PyErr_NewException
(
"vlc.InternalException"
,
NULL
,
NULL
);
Py_INCREF
(
MediaControl_InternalException
);
PyModule_AddObject
(
m
,
"InternalException"
,
MediaControl_InternalException
);
PyModule_AddObject
(
m
,
"InternalException"
,
MediaControl_InternalException
);
MediaControl_PositionKeyNotSupported
=
MediaControl_PositionKeyNotSupported
=
PyErr_NewException
(
"vlc.PositionKeyNotSupported"
,
NULL
,
NULL
);
PyErr_NewException
(
"vlc.PositionKeyNotSupported"
,
NULL
,
NULL
);
Py_INCREF
(
MediaControl_PositionKeyNotSupported
);
PyModule_AddObject
(
m
,
"PositionKeyNotSupported"
,
PyModule_AddObject
(
m
,
"PositionKeyNotSupported"
,
MediaControl_PositionKeyNotSupported
);
MediaControl_PositionKeyNotSupported
);
MediaControl_PositionOriginNotSupported
=
MediaControl_PositionOriginNotSupported
=
PyErr_NewException
(
"vlc.InvalidPosition"
,
NULL
,
NULL
);
PyErr_NewException
(
"vlc.InvalidPosition"
,
NULL
,
NULL
);
Py_INCREF
(
MediaControl_PositionOriginNotSupported
);
PyModule_AddObject
(
m
,
"PositionOriginNotSupported"
,
PyModule_AddObject
(
m
,
"PositionOriginNotSupported"
,
MediaControl_PositionOriginNotSupported
);
MediaControl_PositionOriginNotSupported
);
MediaControl_InvalidPosition
=
MediaControl_InvalidPosition
=
PyErr_NewException
(
"vlc.InvalidPosition"
,
NULL
,
NULL
);
PyErr_NewException
(
"vlc.InvalidPosition"
,
NULL
,
NULL
);
Py_INCREF
(
MediaControl_InvalidPosition
);
PyModule_AddObject
(
m
,
"InvalidPosition"
,
MediaControl_InvalidPosition
);
PyModule_AddObject
(
m
,
"InvalidPosition"
,
MediaControl_InvalidPosition
);
MediaControl_PlaylistException
=
MediaControl_PlaylistException
=
PyErr_NewException
(
"vlc.PlaylistException"
,
NULL
,
NULL
);
PyErr_NewException
(
"vlc.PlaylistException"
,
NULL
,
NULL
);
Py_INCREF
(
MediaControl_PlaylistException
);
PyModule_AddObject
(
m
,
"PlaylistException"
,
MediaControl_PlaylistException
);
PyModule_AddObject
(
m
,
"PlaylistException"
,
MediaControl_PlaylistException
);
/* Types */
/* Types */
Py_INCREF
(
&
PyPosition_Type
);
Py_INCREF
(
&
PyPosition_Type
);
PyModule_AddObject
(
m
,
"Position"
,
(
PyObject
*
)
&
PyPosition_Type
);
PyModule_AddObject
(
m
,
"Position"
,
(
PyObject
*
)
&
PyPosition_Type
);
Py_INCREF
(
&
MediaControl_Type
);
Py_INCREF
(
&
MediaControl_Type
);
PyModule_AddObject
(
m
,
"MediaControl"
,
(
PyObject
*
)
&
MediaControl_Type
);
PyModule_AddObject
(
m
,
"MediaControl"
,
(
PyObject
*
)
&
MediaControl_Type
);
#ifdef VLCOBJECT_SUPPORT
#ifdef VLCOBJECT_SUPPORT
Py_INCREF
(
&
vlcObject_Type
);
Py_INCREF
(
&
vlcObject_Type
);
PyModule_AddObject
(
m
,
"Object"
,
(
PyObject
*
)
&
vlcObject_Type
);
PyModule_AddObject
(
m
,
"Object"
,
(
PyObject
*
)
&
vlcObject_Type
);
...
@@ -284,10 +294,7 @@ static PyObject * vlcObject_find_id(PyObject *self, PyObject *args)
...
@@ -284,10 +294,7 @@ static PyObject * vlcObject_find_id(PyObject *self, PyObject *args)
int
i_id
;
int
i_id
;
if
(
!
PyArg_ParseTuple
(
args
,
"i"
,
&
i_id
)
)
if
(
!
PyArg_ParseTuple
(
args
,
"i"
,
&
i_id
)
)
{
return
NULL
;
PyErr_SetString
(
PyExc_StandardError
,
"Error: no id was given.
\n
"
);
return
Py_None
;
}
p_object
=
(
vlc_object_t
*
)
vlc_current_object
(
i_id
);
p_object
=
(
vlc_object_t
*
)
vlc_current_object
(
i_id
);
...
@@ -314,17 +321,12 @@ static PyObject * vlcObject_var_get(PyObject *self, PyObject *args)
...
@@ -314,17 +321,12 @@ static PyObject * vlcObject_var_get(PyObject *self, PyObject *args)
int
i_type
;
int
i_type
;
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
psz_name
)
)
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
psz_name
)
)
{
return
NULL
;
PyErr_SetString
(
PyExc_StandardError
,
"Error: no variable name was given.
\n
"
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
if
(
var_Get
(
VLCSELF
->
p_object
,
psz_name
,
&
value
)
!=
VLC_SUCCESS
)
if
(
var_Get
(
VLCSELF
->
p_object
,
psz_name
,
&
value
)
!=
VLC_SUCCESS
)
{
{
PyErr_SetString
(
PyExc_StandardError
,
"Error: no variable name was given.
\n
"
);
PyErr_SetString
(
PyExc_StandardError
,
"Error: no variable name was given.
\n
"
);
Py_INCREF
(
Py_None
);
return
NULL
;
return
Py_None
;
}
}
i_type
=
var_Type
(
VLCSELF
->
p_object
,
psz_name
);
i_type
=
var_Type
(
VLCSELF
->
p_object
,
psz_name
);
...
@@ -384,11 +386,7 @@ static PyObject * vlcObject_var_type(PyObject *self,
...
@@ -384,11 +386,7 @@ static PyObject * vlcObject_var_type(PyObject *self,
int
i_type
;
int
i_type
;
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
psz_name
))
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
psz_name
))
{
return
NULL
;
PyErr_SetString
(
PyExc_StandardError
,
"Error: no variable name was given.
\n
"
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
i_type
=
var_Type
(
VLCSELF
->
p_object
,
psz_name
);
i_type
=
var_Type
(
VLCSELF
->
p_object
,
psz_name
);
...
@@ -454,11 +452,7 @@ static PyObject * vlcObject_var_set(PyObject *self,
...
@@ -454,11 +452,7 @@ static PyObject * vlcObject_var_set(PyObject *self,
vlc_object_t
*
p_obj
;
vlc_object_t
*
p_obj
;
if
(
!
PyArg_ParseTuple
(
args
,
"sO"
,
&
psz_name
,
&
py_value
)
)
if
(
!
PyArg_ParseTuple
(
args
,
"sO"
,
&
psz_name
,
&
py_value
)
)
{
return
NULL
;
PyErr_SetString
(
PyExc_StandardError
,
"Error: no variable name was given.
\n
"
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
p_obj
=
VLCSELF
->
p_object
;
p_obj
=
VLCSELF
->
p_object
;
i_type
=
var_Type
(
p_obj
,
psz_name
);
i_type
=
var_Type
(
p_obj
,
psz_name
);
...
@@ -537,11 +531,7 @@ static PyObject * vlcObject_config_get(PyObject *self,
...
@@ -537,11 +531,7 @@ static PyObject * vlcObject_config_get(PyObject *self,
module_config_t
*
p_config
;
module_config_t
*
p_config
;
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
psz_name
)
)
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
psz_name
)
)
{
return
NULL
;
PyErr_SetString
(
PyExc_StandardError
,
"Error: no config variable name was given.
\n
"
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
p_config
=
config_FindConfig
(
VLCSELF
->
p_object
,
psz_name
);
p_config
=
config_FindConfig
(
VLCSELF
->
p_object
,
psz_name
);
...
@@ -600,12 +590,7 @@ static PyObject * vlcObject_config_set(PyObject *self,
...
@@ -600,12 +590,7 @@ static PyObject * vlcObject_config_set(PyObject *self,
if
(
!
PyArg_ParseTuple
(
args
,
"sO"
,
&
psz_name
,
&
py_value
)
)
if
(
!
PyArg_ParseTuple
(
args
,
"sO"
,
&
psz_name
,
&
py_value
)
)
{
return
NULL
;
PyErr_SetString
(
PyExc_StandardError
,
"Error: no variable name was given.
\n
"
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
p_obj
=
VLCSELF
->
p_object
;
p_obj
=
VLCSELF
->
p_object
;
p_config
=
config_FindConfig
(
p_obj
,
psz_name
);
p_config
=
config_FindConfig
(
p_obj
,
psz_name
);
...
@@ -780,7 +765,7 @@ static PyObject *MediaControl_new(PyTypeObject *type, PyObject *args, PyObject *
...
@@ -780,7 +765,7 @@ static PyObject *MediaControl_new(PyTypeObject *type, PyObject *args, PyObject *
else
else
{
{
/* No arguments were given. Clear the exception raised
/* No arguments were given. Clear the exception raised
*
by PyArg_ParseTuple. */
by PyArg_ParseTuple. */
PyErr_Clear
();
PyErr_Clear
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment