[vlc-commits] lib: remove dead code

Rémi Denis-Courmont git at videolan.org
Wed Aug 5 20:31:26 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug  5 20:04:56 2015 +0300| [e15851d57ac673d85db1413cd05684ff8f256ede] | committer: Rémi Denis-Courmont

lib: remove dead code

As of a2ab8b276c9628403f237b7e1b1cb1ffdbf16465, there is always a media
player underneath the media list player.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e15851d57ac673d85db1413cd05684ff8f256ede
---

 lib/media_list_player.c |   23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/lib/media_list_player.c b/lib/media_list_player.c
index 80aadbb..4a8e863 100644
--- a/lib/media_list_player.c
+++ b/lib/media_list_player.c
@@ -383,7 +383,6 @@ static void
 uninstall_media_player_observer(libvlc_media_list_player_t * p_mlp)
 {
     assert_locked(p_mlp);
-    if (!p_mlp->p_mi) return;
 
     // From now on, media_player callback won't be relevant.
     p_mlp->are_mp_callback_cancelled = true;
@@ -609,11 +608,6 @@ void libvlc_media_list_player_play(libvlc_media_list_player_t * p_mlp)
 void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp)
 {
     lock(p_mlp);
-    if (!p_mlp->p_mi)
-    {
-        unlock(p_mlp);
-        return;
-    }
     libvlc_media_player_pause(p_mlp->p_mi);
     unlock(p_mlp);
 }
@@ -624,10 +618,6 @@ void libvlc_media_list_player_pause(libvlc_media_list_player_t * p_mlp)
 int
 libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp)
 {
-    if (!p_mlp->p_mi)
-    {
-        return libvlc_NothingSpecial;
-    }
     libvlc_state_t state = libvlc_media_player_get_state(p_mlp->p_mi);
     return (state == libvlc_Opening) || (state == libvlc_Buffering) ||
            (state == libvlc_Playing);
@@ -639,8 +629,6 @@ libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp)
 libvlc_state_t
 libvlc_media_list_player_get_state(libvlc_media_list_player_t * p_mlp)
 {
-    if (!p_mlp->p_mi)
-        return libvlc_Ended;
     return libvlc_media_player_get_state(p_mlp->p_mi);
 }
 
@@ -694,13 +682,10 @@ static void stop(libvlc_media_list_player_t * p_mlp)
 {
     assert_locked(p_mlp);
 
-    if (p_mlp->p_mi)
-    {
-        /* We are not interested in getting media stop event now */
-        uninstall_media_player_observer(p_mlp);
-        libvlc_media_player_stop(p_mlp->p_mi);
-        install_media_player_observer(p_mlp);
-    }
+    /* We are not interested in getting media stop event now */
+    uninstall_media_player_observer(p_mlp);
+    libvlc_media_player_stop(p_mlp->p_mi);
+    install_media_player_observer(p_mlp);
 
     free(p_mlp->current_playing_item_path);
     p_mlp->current_playing_item_path = NULL;



More information about the vlc-commits mailing list