Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
ad3a3005
Commit
ad3a3005
authored
Feb 25, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: Simplify media_list_player test.
parent
92bdd6e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
62 deletions
+41
-62
test/libvlc/media_list_player.c
test/libvlc/media_list_player.c
+41
-62
No files found.
test/libvlc/media_list_player.c
View file @
ad3a3005
...
...
@@ -61,7 +61,25 @@ static inline void wait_queued_items(struct check_items_order_data *check)
{
// Wait dummily for check_items_order_callback() to flag 'done_playing':
while
(
!
check
->
done_playing
)
msleep
(
100000
);
sched_yield
();
}
static
inline
void
wait_playing
(
libvlc_media_list_player_t
*
mlp
)
{
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
}
static
inline
void
wait_stopped
(
libvlc_media_list_player_t
*
mlp
)
{
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
}
static
inline
void
stop_and_wait
(
libvlc_media_list_player_t
*
mlp
)
{
libvlc_media_list_player_stop
(
mlp
);
wait_stopped
(
mlp
);
}
static
void
check_items_order_callback
(
const
libvlc_event_t
*
p_event
,
void
*
user_data
)
...
...
@@ -148,9 +166,7 @@ static void test_media_list_player_items_queue(const char** argv, int argc)
// Wait until all item are read
wait_queued_items
(
&
check
);
libvlc_media_list_player_stop
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_list_player_release
(
mlp
);
libvlc_release
(
vlc
);
...
...
@@ -190,36 +206,26 @@ static void test_media_list_player_previous(const char** argv, int argc)
libvlc_media_list_player_play_item
(
mlp
,
md
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_release
(
md
);
libvlc_media_list_player_previous
(
mlp
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_pause
(
mlp
);
libvlc_media_list_player_previous
(
mlp
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
libvlc_media_list_player_stop
(
mlp
);
wait_playing
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_list_player_previous
(
mlp
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
libvlc_media_list_player_stop
(
mlp
);
wait_playing
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_list_player_release
(
mlp
);
libvlc_release
(
vlc
);
...
...
@@ -261,33 +267,24 @@ static void test_media_list_player_next(const char** argv, int argc)
libvlc_media_release
(
md
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_next
(
mlp
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_pause
(
mlp
);
libvlc_media_list_player_next
(
mlp
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_stop
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_list_player_next
(
mlp
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_stop
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_list_player_release
(
mlp
);
libvlc_release
(
vlc
);
...
...
@@ -322,14 +319,11 @@ static void test_media_list_player_pause_stop(const char** argv, int argc)
libvlc_media_list_player_play_item
(
mlp
,
md
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_pause
(
mlp
);
libvlc_media_list_player_stop
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_release
(
md
);
libvlc_media_list_player_release
(
mlp
);
...
...
@@ -360,20 +354,14 @@ static void test_media_list_player_play_item_at_index(const char** argv, int arg
assert
(
mlp
);
for
(
unsigned
i
=
0
;
i
<
5
;
i
++
)
{
libvlc_media_list_add_media
(
ml
,
md
);
}
libvlc_media_list_player_set_media_list
(
mlp
,
ml
);
libvlc_media_list_player_play_item_at_index
(
mlp
,
0
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
libvlc_media_list_player_stop
(
mlp
);
wait_playing
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_release
(
md
);
libvlc_media_list_player_release
(
mlp
);
...
...
@@ -488,8 +476,7 @@ static void test_media_list_player_playback_options (const char** argv, int argc
libvlc_media_list_player_play_item
(
mlp
,
md
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_release
(
md
);
libvlc_media_release
(
md2
);
...
...
@@ -508,13 +495,9 @@ static void test_media_list_player_playback_options (const char** argv, int argc
libvlc_media_list_player_play_item
(
mlp
,
md
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_stop
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
// Test repeat playback mode
log
(
"Testing media player playback option - Repeat
\n
"
);
...
...
@@ -522,13 +505,9 @@ static void test_media_list_player_playback_options (const char** argv, int argc
libvlc_media_list_player_play_item
(
mlp
,
md
);
while
(
!
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
wait_playing
(
mlp
);
libvlc_media_list_player_stop
(
mlp
);
while
(
libvlc_media_list_player_is_playing
(
mlp
))
sched_yield
();
stop_and_wait
(
mlp
);
libvlc_media_list_player_release
(
mlp
);
libvlc_release
(
vlc
);
...
...
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