]> git.sesse.net Git - vlc/blobdiff - modules/codec/cmml/intf.c
Input access locking, part 3 (final).
[vlc] / modules / codec / cmml / intf.c
index 78daaf7e1ffe9efcbd7c86e77da494b2b25219f2..fa45e66d25d3ea5bca6b30a350b7e999f7848334 100644 (file)
 #include <vlc/vlc.h>
 
 #include <stdio.h>
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>
 
 #ifdef HAVE_UNISTD_H
 #    include <unistd.h>
 #endif
 
-#include <vlc/decoder.h>
-#include <vlc/input.h>
-#include <vlc/intf.h>
-#include <vlc/vout.h>
-
+#include <vlc_codec.h>
+#include <vlc_input.h>
+#include <vlc_interface.h>
+#include <vlc_vout.h>
+#include <vlc_playlist.h>
 #include <vlc_osd.h>
 
 #include "vlc_keys.h"
@@ -462,13 +460,13 @@ static void FollowAnchor ( intf_thread_t *p_intf )
 
         /* Get new URL */
         p_current_item = p_playlist->status.p_item;
+        char *psz_uri = input_item_GetURI( p_current_item->p_input );
 #ifdef CMML_INTF_DEBUG
-        msg_Dbg( p_intf, "Current playlist item URL is \"%s\"",
-                p_current_item->input.psz_uri );
+        msg_Dbg( p_intf, "Current playlist item URL is \"%s\"", psz_uri );
 #endif
 
-        psz_uri_to_load = XURL_Concat( p_current_item->p_input->psz_uri,
-                                       psz_url );
+        psz_uri_to_load = XURL_Concat( psz_uri, psz_url );
+        free( psz_uri );
 
 #ifdef CMML_INTF_DEBUG
         msg_Dbg( p_intf, "URL to load is \"%s\"", psz_uri_to_load );
@@ -533,7 +531,7 @@ static void FollowAnchor ( intf_thread_t *p_intf )
             msg_Dbg( p_intf, "calling browser_Open with \"%s\"", psz_url );
 #endif
             (void) browser_Open( psz_url );
-            playlist_Control( p_playlist, PLAYLIST_PAUSE, 0 );
+            playlist_Control( p_playlist, PLAYLIST_PAUSE, VLC_TRUE, 0 );
         }
 
         free( psz_uri_to_load );
@@ -552,7 +550,9 @@ char *GetTimedURLFromPlaylistItem( intf_thread_t *p_intf,
     char *psz_seconds = NULL;
     int i_seconds;
 
-    psz_url = XURL_GetWithoutFragment( p_current_item->input->psz_uri );
+    char *psz_uri = input_item_GetURI( p_current_item->p_input );
+    psz_url = XURL_GetWithoutFragment( psz_uri );
+    free( psz_uri );
 
     /* Get current time as a string */
     if( XURL_IsFileURL( psz_url ) == VLC_TRUE )
@@ -578,7 +578,7 @@ char *GetTimedURLFromPlaylistItem( intf_thread_t *p_intf,
     p = GetTimedURIFragmentForTime; /* unused */
     p = GetCurrentTimeInSeconds;    /* unused */
 
-    return strdup( p_current_item->p_input->psz_uri );
+    return input_item_GetURI( p_current_item->p_input );
 #endif
 }
 
@@ -795,8 +795,9 @@ void GoForward( intf_thread_t *p_intf )
 static void ReplacePlaylistItem( playlist_t *p_playlist, char *psz_uri )
 {
     playlist_Stop( p_playlist );
-    (void) playlist_PlaylistAdd( p_playlist, psz_uri, psz_uri,
-                         PLAYLIST_INSERT /* FIXME: used to be PLAYLIST_REPLACE */, PLAYLIST_END|PLAYLIST_GO /* FIXME: p_playlist->status.i_index */ );
+    (void) playlist_Add( p_playlist, psz_uri, psz_uri,
+                         PLAYLIST_INSERT /* FIXME: used to be PLAYLIST_REPLACE */, PLAYLIST_END|PLAYLIST_GO, VLC_TRUE /* FIXME: p_playlist->status.i_index */,
+                         VLC_FALSE);
 }
 
 /****************************************************************************