]> git.sesse.net Git - vlc/blobdiff - modules/codec/cmml/intf.c
Fix invalid mix of closedir and free on Win32.
[vlc] / modules / codec / cmml / intf.c
index 7c633b594a8a894c953a61b3d1651a7be1ba9c18..72e5c5a9884990ae2379f2603a9a38fe766be8df 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#include <vlc/vlc.h>
+
+#include <stdio.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
-#include <vlc/vlc.h>
-
 #ifdef HAVE_UNISTD_H
 #    include <unistd.h>
 #endif
@@ -119,18 +120,18 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
 
     p_intf->pf_run = RunIntf;
 
-    var_AddCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
+    var_AddCallback( p_intf->p_libvlc, "key-pressed", KeyEvent, p_intf );
     /* we also need to add the callback for "mouse-clicked", but do that later
      * when we've found a p_vout */
 
-    var_Create( p_intf->p_vlc, "browse-go-back", VLC_VAR_VOID );
-    var_AddCallback( p_intf->p_vlc, "browse-go-back",
+    var_Create( p_intf->p_libvlc, "browse-go-back", VLC_VAR_VOID );
+    var_AddCallback( p_intf->p_libvlc, "browse-go-back",
                      GoBackCallback, p_intf );
-    var_Create( p_intf->p_vlc, "browse-go-forward", VLC_VAR_VOID );
-    var_AddCallback( p_intf->p_vlc, "browse-go-forward",
+    var_Create( p_intf->p_libvlc, "browse-go-forward", VLC_VAR_VOID );
+    var_AddCallback( p_intf->p_libvlc, "browse-go-forward",
                      GoForwardCallback, p_intf );
-    var_Create( p_intf->p_vlc, "browse-follow-anchor", VLC_VAR_VOID );
-    var_AddCallback( p_intf->p_vlc, "browse-follow-anchor",
+    var_Create( p_intf->p_libvlc, "browse-follow-anchor", VLC_VAR_VOID );
+    var_AddCallback( p_intf->p_libvlc, "browse-follow-anchor",
                      FollowAnchorCallback, p_intf );
 
     return( 0 );
@@ -157,7 +158,7 @@ void E_(CloseIntf) ( vlc_object_t *p_this )
         vlc_object_release( p_vout );
     }
 
-    var_DelCallback( p_intf->p_vlc, "key-pressed", KeyEvent, p_intf );
+    var_DelCallback( p_intf->p_libvlc, "key-pressed", KeyEvent, p_intf );
 
     vlc_object_release( p_intf->p_sys->p_cmml_decoder );
 
@@ -216,10 +217,10 @@ static void RunIntf( intf_thread_t *p_intf )
         {
             vlc_value_t val;
             int i, i_action = -1;
-            struct hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys;
+            struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
 
             /* Find action triggered by hotkey (if any) */
-            var_Get( p_intf->p_vlc, "key-pressed", &val );
+            var_Get( p_intf->p_libvlc, "key-pressed", &val );
 
             /* Acknowledge that we've handled the b_key_pressed event */
             p_intf->p_sys->b_key_pressed = VLC_FALSE;
@@ -307,7 +308,7 @@ static int DisplayPendingAnchor( intf_thread_t *p_intf, vout_thread_t *p_vout )
     if( p_vout != NULL )
     {
         /* don't display anchor if main interface can display it */
-        p_primary_intf = vlc_object_find( p_intf->p_vlc, VLC_OBJECT_INTF,
+        p_primary_intf = vlc_object_find( p_intf->p_libvlc, VLC_OBJECT_INTF,
                 FIND_CHILD );
 
         if( p_primary_intf )
@@ -532,7 +533,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 );
@@ -595,7 +596,6 @@ int GetCurrentTimeInSeconds( input_thread_t *p_input )
 
     var_Get( p_input, "time", &time );
     i_seconds = time.i_time / 1000000;
-
     return i_seconds;
 }
 
@@ -605,7 +605,6 @@ char *GetTimedURIFragmentForTime( int seconds )
     char *psz_time;
 
     asprintf( &psz_time, "%d", seconds );
-
     return psz_time;
 }
 
@@ -796,8 +795,8 @@ 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 */ );
 }
 
 /****************************************************************************
@@ -818,8 +817,6 @@ static int DisplayAnchor( intf_thread_t *p_intf,
 
     if( p_vout )
     {
-        text_style_t *p_style = NULL;
-
         if( psz_anchor_url )
         {
             /* Should display subtitle underlined and in blue, but it looks
@@ -841,7 +838,6 @@ static int DisplayAnchor( intf_thread_t *p_intf,
         {
             return VLC_EGENERIC;
         }
-
     }
     else
     {