X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Fplaylist%2Fifo.c;h=bf02d743554f539aeb9197480300a8e3be91627f;hb=a409380da011ba3fb820b7d2265171239e3b8851;hp=88be49c38ff325bb9d4d70513649be327fc6ba44;hpb=9b749a07457052642c01bfc0cff914c38ba72074;p=vlc diff --git a/modules/demux/playlist/ifo.c b/modules/demux/playlist/ifo.c index 88be49c38f..bf02d74355 100644 --- a/modules/demux/playlist/ifo.c +++ b/modules/demux/playlist/ifo.c @@ -24,7 +24,11 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include #include #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; }