]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/ifo.c
macosx: Make sure the manageIntf: Timer is getting cancelled at exit.
[vlc] / modules / demux / playlist / ifo.c
index 88be49c38ff325bb9d4d70513649be327fc6ba44..bf02d743554f539aeb9197480300a8e3be91627f 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <vlc_demux.h>
 
 #include "playlist.h"
@@ -38,7 +42,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
 /*****************************************************************************
  * Import_IFO: main import function
  *****************************************************************************/
-int E_(Import_IFO)( vlc_object_t *p_this )
+int Import_IFO( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
 
@@ -54,10 +58,10 @@ int E_(Import_IFO)( vlc_object_t *p_this )
         && !strcasecmp( psz_file + strlen( "VTS_00_0" ) , ".IFO" ) ) ) )
     {
         int i_peek;
-        byte_t *p_peek;
+        const uint8_t *p_peek;
         i_peek = stream_Peek( p_demux->s, &p_peek, 8 );
 
-        if( strncmp( p_peek, "DVDVIDEO", 8 ) )
+        if( i_peek != 8 || memcmp( p_peek, "DVDVIDEO", 8 ) )
             return VLC_EGENERIC;
     }
     else
@@ -73,8 +77,9 @@ int E_(Import_IFO)( vlc_object_t *p_this )
 /*****************************************************************************
  * Deactivate: frees unused data
  *****************************************************************************/
-void E_(Close_IFO)( vlc_object_t *p_this )
+void Close_IFO( vlc_object_t *p_this )
 {
+    VLC_UNUSED(p_this);
 }
 
 static int Demux( demux_t *p_demux )
@@ -90,15 +95,17 @@ static int Demux( demux_t *p_demux )
     psz_url = (char *)malloc( len+1 );
     snprintf( psz_url, len+1, "dvd://%s", p_demux->psz_path );
 
-    p_input = input_ItemNewExt( p_playlist, psz_url, psz_url, 0, NULL, -1 );
+    p_input = input_ItemNewExt( p_demux, psz_url, psz_url, 0, NULL, -1 );
     input_ItemAddSubItem( p_current_input, p_input );
+    vlc_gc_decref( p_input );
 
     HANDLE_PLAY_AND_RELEASE;
 
-    return -1; /* Needed for correct operation of go back */
+    return 0; /* Needed for correct operation of go back */
 }
 
 static int Control( demux_t *p_demux, int i_query, va_list args )
 {
+    VLC_UNUSED(p_demux); VLC_UNUSED(i_query); VLC_UNUSED(args);
     return VLC_EGENERIC;
 }