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
82c5d9de
Commit
82c5d9de
authored
Feb 18, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: Add a test for media_player_set_media().
parent
27934aa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
test/libvlc/media_player.c
test/libvlc/media_player.c
+38
-1
No files found.
test/libvlc/media_player.c
View file @
82c5d9de
...
...
@@ -23,6 +23,42 @@
#include "test.h"
static
void
test_media_player_set_media
(
const
char
**
argv
,
int
argc
)
{
const
char
*
file
=
test_default_sample
;
log
(
"Testing set_media
\n
"
);
libvlc_instance_t
*
vlc
=
libvlc_new
(
argc
,
argv
);
assert
(
vlc
!=
NULL
);
libvlc_media_t
*
md
=
libvlc_media_new
(
vlc
,
file
);
assert
(
md
!=
NULL
);
libvlc_media_player_t
*
mp
=
libvlc_media_player_new
(
vlc
);
assert
(
mp
!=
NULL
);
libvlc_media_player_set_media
(
mp
,
md
);
libvlc_media_release
(
md
);
libvlc_media_player_play
(
mp
);
/* Wait a correct state */
libvlc_state_t
state
;
do
{
state
=
libvlc_media_player_get_state
(
mp
);
}
while
(
state
!=
libvlc_Playing
&&
state
!=
libvlc_Error
&&
state
!=
libvlc_Ended
);
assert
(
state
==
libvlc_Playing
||
state
==
libvlc_Ended
);
libvlc_media_player_stop
(
mp
);
libvlc_media_player_release
(
mp
);
libvlc_release
(
vlc
);
}
static
void
test_media_player_play_stop
(
const
char
**
argv
,
int
argc
)
{
libvlc_instance_t
*
vlc
;
...
...
@@ -110,7 +146,7 @@ static void test_media_player_pause_stop(const char** argv, int argc)
assert( state == libvlc_Paused || state == libvlc_Ended );
#endif
libvlc_media_player_stop
(
mi
);
libvlc_media_player_release
(
mi
);
libvlc_release
(
vlc
);
...
...
@@ -121,6 +157,7 @@ int main (void)
{
test_init
();
test_media_player_set_media
(
test_defaults_args
,
test_defaults_nargs
);
test_media_player_play_stop
(
test_defaults_args
,
test_defaults_nargs
);
test_media_player_pause_stop
(
test_defaults_args
,
test_defaults_nargs
);
...
...
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