[vlc-devel] commit: Added some additional locking to the media list player playitem functions to prevent threading instability . (Niles Bindel )
git version control
git at videolan.org
Tue Aug 25 00:09:09 CEST 2009
vlc | branch: master | Niles Bindel <zaggal69 at gmail.com> | Mon Aug 24 15:10:50 2009 -0500| [c1c1ff8e3446ba14b074fa44666ef47e7638c6d0] | committer: Pierre d'Herbemont
Added some additional locking to the media list player playitem functions to prevent threading instability.
Signed-off-by: Pierre d'Herbemont <pdherbemont at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1c1ff8e3446ba14b074fa44666ef47e7638c6d0
---
src/control/media_list_player.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/control/media_list_player.c b/src/control/media_list_player.c
index 1c91799..0f04888 100644
--- a/src/control/media_list_player.c
+++ b/src/control/media_list_player.c
@@ -502,7 +502,10 @@ libvlc_media_list_player_get_state(libvlc_media_list_player_t * p_mlp, libvlc_ex
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_UNUSED(p_e);
+
+ lock(p_mlp);
set_current_playing_item(p_mlp, libvlc_media_list_path_with_root_index(i_index));
+ unlock(p_mlp);
/* Send the next item event */
libvlc_event_t event;
@@ -523,7 +526,11 @@ void libvlc_media_list_player_play_item(libvlc_media_list_player_t * p_mlp, libv
libvlc_exception_raise(p_e, "No such item in media list");
return;
}
+
+ lock(p_mlp);
set_current_playing_item(p_mlp, path);
+ unlock(p_mlp);
+
libvlc_media_player_play(p_mlp->p_mi, p_e);
}
More information about the vlc-devel
mailing list