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
934b28d9
Commit
934b28d9
authored
Feb 02, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: Remove exception from media_list_player.
parent
db14d090
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
66 deletions
+45
-66
include/vlc/libvlc_media_list_player.h
include/vlc/libvlc_media_list_player.h
+21
-35
projects/macosx/framework/Sources/VLCMediaListPlayer.m
projects/macosx/framework/Sources/VLCMediaListPlayer.m
+2
-2
src/control/media_list_player.c
src/control/media_list_player.c
+22
-29
No files found.
include/vlc/libvlc_media_list_player.h
View file @
934b28d9
...
...
@@ -59,7 +59,6 @@ typedef enum libvlc_playback_mode_t
* Create new media_list_player.
*
* \param p_instance libvlc instance
* \param p_e initialized exception instance
* \return media list player instance or NULL on error
*/
VLC_PUBLIC_API
libvlc_media_list_player_t
*
...
...
@@ -86,7 +85,6 @@ VLC_PUBLIC_API libvlc_event_manager_t *
*
* \param p_mlp media list player instance
* \param p_mi media player instance
* \param p_e initialized exception instance
*/
VLC_PUBLIC_API
void
libvlc_media_list_player_set_media_player
(
...
...
@@ -102,27 +100,22 @@ VLC_PUBLIC_API void
* Play media list
*
* \param p_mlp media list player instance
* \param p_e initialized exception instance
*/
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
(
libvlc_media_list_player_t
*
p_mlp
);
/**
* Pause media list
*
* \param p_mlp media list player instance
* \param p_e initialized exception instance
*/
VLC_PUBLIC_API
void
libvlc_media_list_player_pause
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
void
libvlc_media_list_player_pause
(
libvlc_media_list_player_t
*
p_mlp
);
/**
* Is media list playing?
*
* \param p_mlp media list player instance
* \param p_e initialized exception instance
* \return true for playing and false for not playing
*/
VLC_PUBLIC_API
int
...
...
@@ -142,19 +135,15 @@ VLC_PUBLIC_API libvlc_state_t
*
* \param p_mlp media list player instance
* \param i_index index in media list to play
* \
param p_e initialized exception instance
* \
return 0 upon success -1 if the item wasn't found
*/
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
int
libvlc_media_list_player_play_item_at_index
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_index
);
VLC_PUBLIC_API
void
libvlc_media_list_player_play_item
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_media_t
*
p_md
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
int
libvlc_media_list_player_play_item
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_media_t
*
p_md
);
/**
* Stop playing media list
...
...
@@ -162,27 +151,25 @@ VLC_PUBLIC_API void
* \param p_mlp media list player instance
*/
VLC_PUBLIC_API
void
libvlc_media_list_player_stop
(
libvlc_media_list_player_t
*
p_mlp
);
libvlc_media_list_player_stop
(
libvlc_media_list_player_t
*
p_mlp
);
/**
* Play next item from media list
*
* \param p_mlp media list player instance
* \
param p_e initialized exception instance
* \
return 0 upon success -1 if there is no next item
*/
VLC_PUBLIC_API
void
libvlc_media_list_player_next
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
int
libvlc_media_list_player_next
(
libvlc_media_list_player_t
*
p_mlp
);
/**
* Play previous item from media list
*
* \param p_mlp media list player instance
* \
param p_e initialized exception instance
* \
return 0 upon success -1 if there is no previous item
*/
VLC_PUBLIC_API
void
libvlc_media_list_player_previous
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
);
VLC_PUBLIC_API
int
libvlc_media_list_player_previous
(
libvlc_media_list_player_t
*
p_mlp
);
...
...
@@ -192,10 +179,9 @@ VLC_PUBLIC_API void
* \param p_mlp media list player instance
* \param e_mode playback mode specification
*/
VLC_PUBLIC_API
void
libvlc_media_list_player_set_playback_mode
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_playback_mode_t
e_mode
);
VLC_PUBLIC_API
void
libvlc_media_list_player_set_playback_mode
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_playback_mode_t
e_mode
);
/** @} media_list_player */
...
...
projects/macosx/framework/Sources/VLCMediaListPlayer.m
View file @
934b28d9
...
...
@@ -104,7 +104,7 @@
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_media_list_player_play_item
(
instance
,
[
media
libVLCMediaDescriptor
]
,
&
ex
);
libvlc_media_list_player_play_item
(
instance
,
[
media
libVLCMediaDescriptor
]);
catch_exception
(
&
ex
);
}
...
...
@@ -112,7 +112,7 @@
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_media_list_player_play
(
instance
,
&
ex
);
libvlc_media_list_player_play
(
instance
);
catch_exception
(
&
ex
);
}
...
...
src/control/media_list_player.c
View file @
934b28d9
...
...
@@ -80,10 +80,9 @@ static inline void vlc_assert_locked(vlc_mutex_t *mutex)
* Forward declaration
*/
static
void
set_relative_playlist_position_and_play
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_relative_position
,
libvlc_exception_t
*
p_e
);
static
int
set_relative_playlist_position_and_play
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_relative_position
);
static
void
stop
(
libvlc_media_list_player_t
*
p_mlp
);
/*
...
...
@@ -328,16 +327,11 @@ media_player_reached_end(const libvlc_event_t * p_event, void * p_user_data)
{
VLC_UNUSED
(
p_event
);
libvlc_media_list_player_t
*
p_mlp
=
p_user_data
;
libvlc_exception_t
e
;
libvlc_exception_init
(
&
e
);
vlc_mutex_lock
(
&
p_mlp
->
mp_callback_lock
);
if
(
!
p_mlp
->
are_mp_callback_cancelled
)
set_relative_playlist_position_and_play
(
p_mlp
,
1
,
&
e
);
set_relative_playlist_position_and_play
(
p_mlp
,
1
);
vlc_mutex_unlock
(
&
p_mlp
->
mp_callback_lock
);
// There is no point in reporting an error from this callback
libvlc_exception_clear
(
&
e
);
}
/**************************************************************************
...
...
@@ -578,12 +572,12 @@ void libvlc_media_list_player_set_media_list(libvlc_media_list_player_t * p_mlp,
/**************************************************************************
* Play (Public)
**************************************************************************/
void
libvlc_media_list_player_play
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
)
void
libvlc_media_list_player_play
(
libvlc_media_list_player_t
*
p_mlp
)
{
lock
(
p_mlp
);
if
(
!
p_mlp
->
current_playing_item_path
)
{
set_relative_playlist_position_and_play
(
p_mlp
,
1
,
p_e
);
set_relative_playlist_position_and_play
(
p_mlp
,
1
);
unlock
(
p_mlp
);
return
;
/* Will set to play */
}
...
...
@@ -595,7 +589,7 @@ void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp, libvlc_ex
/**************************************************************************
* Pause (Public)
**************************************************************************/
void
libvlc_media_list_player_pause
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
)
void
libvlc_media_list_player_pause
(
libvlc_media_list_player_t
*
p_mlp
)
{
lock
(
p_mlp
);
if
(
!
p_mlp
->
p_mi
)
...
...
@@ -632,7 +626,7 @@ libvlc_media_list_player_get_state(libvlc_media_list_player_t * p_mlp)
/**************************************************************************
* Play item at index (Public)
**************************************************************************/
void
libvlc_media_list_player_play_item_at_index
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_index
,
libvlc_exception_t
*
p_e
)
int
libvlc_media_list_player_play_item_at_index
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_index
)
{
lock
(
p_mlp
);
set_current_playing_item
(
p_mlp
,
libvlc_media_list_path_with_root_index
(
i_index
));
...
...
@@ -643,26 +637,27 @@ void libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_t * p_
libvlc_event_t
event
;
event
.
type
=
libvlc_MediaListPlayerNextItemSet
;
libvlc_event_send
(
p_mlp
->
p_event_manager
,
&
event
);
return
0
;
}
/**************************************************************************
* Play item (Public)
**************************************************************************/
void
libvlc_media_list_player_play_item
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_media_t
*
p_md
,
libvlc_exception_t
*
p_e
)
int
libvlc_media_list_player_play_item
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_media_t
*
p_md
)
{
lock
(
p_mlp
);
libvlc_media_list_path_t
path
=
libvlc_media_list_path_of_item
(
p_mlp
->
p_mlist
,
p_md
);
if
(
!
path
)
{
libvlc_exception_raise
(
p_e
);
libvlc_printerr
(
"Item not found in media list"
);
unlock
(
p_mlp
);
return
;
return
-
1
;
}
set_current_playing_item
(
p_mlp
,
path
);
libvlc_media_player_play
(
p_mlp
->
p_mi
);
unlock
(
p_mlp
);
return
0
;
}
/**************************************************************************
...
...
@@ -703,18 +698,16 @@ void libvlc_media_list_player_stop(libvlc_media_list_player_t * p_mlp)
* (based on the currently playing item) and then begins the new item playback.
* Lock must be held.
**************************************************************************/
static
void
set_relative_playlist_position_and_play
(
static
int
set_relative_playlist_position_and_play
(
libvlc_media_list_player_t
*
p_mlp
,
int
i_relative_position
,
libvlc_exception_t
*
p_e
)
int
i_relative_position
)
{
assert_locked
(
p_mlp
);
if
(
!
p_mlp
->
p_mlist
)
{
libvlc_exception_raise
(
p_e
);
libvlc_printerr
(
"No media list"
);
return
;
return
-
1
;
}
libvlc_media_list_lock
(
p_mlp
->
p_mlist
);
...
...
@@ -759,7 +752,7 @@ static void set_relative_playlist_position_and_play(
if
(
!
path
)
{
libvlc_media_list_unlock
(
p_mlp
->
p_mlist
);
return
;
return
-
1
;
}
libvlc_media_player_play
(
p_mlp
->
p_mi
);
...
...
@@ -778,23 +771,23 @@ static void set_relative_playlist_position_and_play(
/**************************************************************************
* Next (Public)
**************************************************************************/
void
libvlc_media_list_player_next
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
)
int
libvlc_media_list_player_next
(
libvlc_media_list_player_t
*
p_mlp
)
{
lock
(
p_mlp
);
set_relative_playlist_position_and_play
(
p_mlp
,
1
,
p_e
);
int
failure
=
set_relative_playlist_position_and_play
(
p_mlp
,
1
);
unlock
(
p_mlp
);
return
failure
;
}
/**************************************************************************
* Previous (Public)
**************************************************************************/
void
libvlc_media_list_player_previous
(
libvlc_media_list_player_t
*
p_mlp
,
libvlc_exception_t
*
p_e
)
int
libvlc_media_list_player_previous
(
libvlc_media_list_player_t
*
p_mlp
)
{
lock
(
p_mlp
);
set_relative_playlist_position_and_play
(
p_mlp
,
-
1
,
p_e
);
int
failure
=
set_relative_playlist_position_and_play
(
p_mlp
,
-
1
);
unlock
(
p_mlp
);
return
failure
;
}
/**************************************************************************
...
...
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