Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
ef273c07
Commit
ef273c07
authored
Feb 14, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some bugs
parent
e0003bec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
20 deletions
+29
-20
src/control/core.c
src/control/core.c
+2
-4
test/NativeLibvlcTest.py
test/NativeLibvlcTest.py
+3
-0
test/PyMediaControlVariablesTest.py
test/PyMediaControlVariablesTest.py
+21
-16
test/native/libvlc.c
test/native/libvlc.c
+3
-0
No files found.
src/control/core.c
View file @
ef273c07
...
...
@@ -62,14 +62,12 @@ inline void libvlc_exception_raise( libvlc_exception_t *p_exception,
{
va_list
args
;
char
*
psz_message
;
va_start
(
args
,
psz_message
);
vasprintf
(
&
psz_message
,
psz_format
,
args
);
va_start
(
args
,
p
_exception
->
p
sz_message
);
vasprintf
(
&
p
_exception
->
p
sz_message
,
psz_format
,
args
);
va_end
(
args
);
if
(
p_exception
==
NULL
)
return
;
p_exception
->
b_raised
=
1
;
if
(
psz_message
)
p_exception
->
psz_message
=
strdup
(
psz_message
);
}
libvlc_instance_t
*
libvlc_new
(
int
argc
,
char
**
argv
,
...
...
test/NativeLibvlcTest.py
View file @
ef273c07
...
...
@@ -13,3 +13,6 @@ class NativeLibvlcTestCase( unittest.TestCase ):
def
testPlaylist
(
self
):
"""[LibVLC] Checks basic playlist interaction"""
native_libvlc_test
.
playlist_test
()
def
testVLM
(
self
):
"""[LibVLC] Checks VLM wrapper"""
native_libvlc_test
.
vlm_test
()
test/PyMediaControlVariablesTest.py
View file @
ef273c07
import
vlc
import
unittest
# FIXME:
How to avoid creating / killing vlc for each test method ?
# FIXME:
Always segfault
class
VariablesTestCase
(
unittest
.
TestCase
):
"""[PyMC] Test misc variables interaction"""
def
setUp
(
self
):
self
.
mc
=
vlc
.
MediaControl
(
[
'--quiet'
]
)
print
"broken"
# self.mc = vlc.MediaControl( [ '--quiet'] )
# FIXME ! - Get this through children test
self
.
libvlc
=
vlc
.
Object
(
1
)
self
.
playlist
=
vlc
.
Object
(
268
)
#
self.libvlc = vlc.Object(1)
#
self.playlist = vlc.Object(268)
def
tearDown
(
self
):
self
.
playlist
.
release
()
self
.
libvlc
.
release
()
self
.
mc
.
exit
()
print
"broken"
# self.playlist.release()
# self.libvlc.release()
# self.mc.exit()
# The Python binding can't create variables, so just get default ones
def
testInt
(
self
):
"""[PyMC] Get/Set integer variable"""
assert
self
.
libvlc
.
get
(
"width"
)
==
0
self
.
libvlc
.
set
(
"width"
,
42
)
assert
self
.
libvlc
.
get
(
'width'
)
==
42
print
"broken"
# assert self.libvlc.get( "width" ) == 0
# self.libvlc.set( "width", 42 )
# assert self.libvlc.get( 'width' ) == 42
# FIXME: Python binding should listen to return value and raise exception
def
testInvalidInt
(
self
):
"""[PyMC] Get/Set invalid integer"""
self
.
libvlc
.
set
(
"width"
,
5
)
self
.
libvlc
.
set
(
"width"
,
"foo"
)
assert
self
.
libvlc
.
get
(
"width"
)
==
-
1
print
"broken"
# self.libvlc.set( "width" , 5 )
# self.libvlc.set( "width", "foo" )
# assert self.libvlc.get( "width" ) == -1
def
testString
(
self
):
"""[PyMC] Get/Set string variable"""
assert
self
.
libvlc
.
get
(
"open"
)
==
''
self
.
libvlc
.
set
(
"open"
,
"foo"
)
assert
self
.
libvlc
.
get
(
"open"
)
==
"foo"
print
"broken"
# assert self.libvlc.get( "open" ) == ''
# self.libvlc.set( "open", "foo" )
# assert self.libvlc.get( "open" ) == "foo"
test/native/libvlc.c
View file @
ef273c07
...
...
@@ -95,6 +95,9 @@ static PyObject *vlm_test( PyObject *self, PyObject *args )
char
*
argv
[]
=
{
"vlc"
,
"--quiet"
};
libvlc_exception_t
exception
;
libvlc_exception_init
(
&
exception
);
p_instance
=
libvlc_new
(
2
,
argv
,
&
exception
);
ASSERT_NOEXCEPTION
;
libvlc_vlm_set_enabled
(
p_instance
,
"test"
,
1
,
&
exception
);
ASSERT_EXCEPTION
;
...
...
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