Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
7b246662
Commit
7b246662
authored
Aug 11, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control/media_list_player.c: Implement _play_item_at_index().
parent
a18fdf18
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
26 deletions
+64
-26
include/vlc/libvlc.h
include/vlc/libvlc.h
+6
-0
src/control/media_list_player.c
src/control/media_list_player.c
+58
-26
No files found.
include/vlc/libvlc.h
View file @
7b246662
...
...
@@ -483,6 +483,12 @@ VLC_PUBLIC_API void
libvlc_media_list_player_play
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
void
libvlc_media_list_player_play_item_at_index
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_index
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
void
libvlc_media_list_player_stop
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
);
...
...
src/control/media_list_player.c
View file @
7b246662
...
...
@@ -149,6 +149,42 @@ libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
return
0
;
}
/**************************************************************************
* Next (private)
*
* Playlist lock should be held
**************************************************************************/
static
void
media_list_player_set_next
(
libvlc_media_list_player_t
*
p_mlp
,
int
index
,
libvlc_exception_t
*
p_e
)
{
libvlc_media_descriptor_t
*
p_md
;
p_md
=
libvlc_media_list_item_at_index
(
p_mlp
->
p_mlist
,
index
,
p_e
);
if
(
!
p_md
)
{
libvlc_media_list_unlock
(
p_mlp
->
p_mlist
);
if
(
!
libvlc_exception_raised
(
p_e
)
)
libvlc_exception_raise
(
p_e
,
"Can't obtain a media"
);
return
;
}
vlc_mutex_lock
(
&
p_mlp
->
object_lock
);
p_mlp
->
i_current_playing_index
=
index
;
/* We are not interested in getting media_descriptor stop event now */
uninstall_media_instance_observer
(
p_mlp
);
libvlc_media_instance_set_media_descriptor
(
p_mlp
->
p_mi
,
p_md
,
NULL
);
// wait_playing_state(); /* If we want to be synchronous */
install_media_instance_observer
(
p_mlp
);
vlc_mutex_unlock
(
&
p_mlp
->
object_lock
);
libvlc_media_list_unlock
(
p_mlp
->
p_mlist
);
libvlc_media_descriptor_release
(
p_md
);
/* for libvlc_media_list_item_at_index */
}
/*
* Public libvlc functions
...
...
@@ -243,6 +279,25 @@ void libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
libvlc_media_instance_play
(
p_mlp
->
p_mi
,
p_e
);
}
/**************************************************************************
* Play item at index (Public)
*
* Playlist lock should be help
**************************************************************************/
void
libvlc_media_list_player_play_item_at_index
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_index
,
libvlc_exception_t
*
p_e
)
{
media_list_player_set_next
(
p_mlp
,
i_index
,
p_e
);
if
(
libvlc_exception_raised
(
p_e
)
)
return
;
libvlc_media_instance_play
(
p_mlp
->
p_mi
,
p_e
);
}
/**************************************************************************
* Stop (Public)
**************************************************************************/
...
...
@@ -261,9 +316,7 @@ void libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
**************************************************************************/
void
libvlc_media_list_player_next
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
)
{
libvlc_media_descriptor_t
*
p_md
;
{
int
index
;
libvlc_media_list_lock
(
p_mlp
->
p_mlist
);
...
...
@@ -278,29 +331,8 @@ void libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
return
;
}
p_md
=
libvlc_media_list_item_at_index
(
p_mlp
->
p_mlist
,
index
,
p_e
);
if
(
!
p_md
)
{
libvlc_media_list_unlock
(
p_mlp
->
p_mlist
);
if
(
!
libvlc_exception_raised
(
p_e
)
)
libvlc_exception_raise
(
p_e
,
"Can't obtain a media"
);
return
;
}
vlc_mutex_lock
(
&
p_mlp
->
object_lock
);
media_list_player_set_next
(
p_mlp
,
index
,
p_e
);
p_mlp
->
i_current_playing_index
=
index
;
/* We are not interested in getting media_descriptor stop event now */
uninstall_media_instance_observer
(
p_mlp
);
libvlc_media_instance_set_media_descriptor
(
p_mlp
->
p_mi
,
p_md
,
NULL
);
// wait_playing_state(); /* If we want to be synchronous */
install_media_instance_observer
(
p_mlp
);
vlc_mutex_unlock
(
&
p_mlp
->
object_lock
);
libvlc_media_list_unlock
(
p_mlp
->
p_mlist
);
libvlc_media_descriptor_release
(
p_md
);
/* for libvlc_media_list_item_at_index */
libvlc_media_list_unlock
(
p_mlp
->
p_mlist
);
}
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