Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Steve Lhomme
vlc
Commits
1b1325c6
Commit
1b1325c6
authored
Feb 25, 2010
by
Pierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: Simplify media_player test.
parent
9dfc36b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
35 deletions
+17
-35
test/libvlc/media_player.c
test/libvlc/media_player.c
+17
-35
No files found.
test/libvlc/media_player.c
View file @
1b1325c6
...
...
@@ -23,6 +23,19 @@
#include "test.h"
static
void
wait_playing
(
libvlc_media_player_t
*
mp
)
{
libvlc_state_t
state
;
do
{
state
=
libvlc_media_player_get_state
(
mp
);
}
while
(
state
!=
libvlc_Playing
&&
state
!=
libvlc_Error
&&
state
!=
libvlc_Ended
);
state
=
libvlc_media_player_get_state
(
mp
);
assert
(
state
==
libvlc_Playing
||
state
==
libvlc_Ended
);
}
static
void
test_media_player_set_media
(
const
char
**
argv
,
int
argc
)
{
const
char
*
file
=
test_default_sample
;
...
...
@@ -44,15 +57,7 @@ static void test_media_player_set_media(const char** argv, int argc)
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
);
wait_playing
(
mp
);
libvlc_media_player_stop
(
mp
);
libvlc_media_player_release
(
mp
);
...
...
@@ -81,15 +86,7 @@ static void test_media_player_play_stop(const char** argv, int argc)
libvlc_media_player_play
(
mi
);
/* Wait a correct state */
libvlc_state_t
state
;
do
{
state
=
libvlc_media_player_get_state
(
mi
);
}
while
(
state
!=
libvlc_Playing
&&
state
!=
libvlc_Error
&&
state
!=
libvlc_Ended
);
assert
(
state
==
libvlc_Playing
||
state
==
libvlc_Ended
);
wait_playing
(
mi
);
libvlc_media_player_stop
(
mi
);
libvlc_media_player_release
(
mi
);
...
...
@@ -120,15 +117,7 @@ static void test_media_player_pause_stop(const char** argv, int argc)
log
(
"Waiting for playing
\n
"
);
/* Wait a correct state */
libvlc_state_t
state
;
do
{
state
=
libvlc_media_player_get_state
(
mi
);
}
while
(
state
!=
libvlc_Playing
&&
state
!=
libvlc_Error
&&
state
!=
libvlc_Ended
);
assert
(
state
==
libvlc_Playing
||
state
==
libvlc_Ended
);
wait_playing
(
mi
);
#if 0
/* This can't work because under some condition (short file, this is the case) this will be
...
...
@@ -137,14 +126,7 @@ static void test_media_player_pause_stop(const char** argv, int argc)
log ("Waiting for pause\n");
/* Wait a correct state */
do {
state = libvlc_media_player_get_state (mi);
} while( state != libvlc_Paused &&
state != libvlc_Error &&
state != libvlc_Ended );
assert( state == libvlc_Paused || state == libvlc_Ended );
wait_paused (mp);
#endif
libvlc_media_player_stop
(
mi
);
...
...
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