/***************************************************************************** * Import_QTL: main import function *****************************************************************************/ int Import_QTL( vlc_object_t *p_this ) { stream_t *p_demux = (stream_t *)p_this; CHECK_FILE(p_demux); if( !stream_HasExtension( p_demux, ".qtl" ) ) return VLC_EGENERIC; p_demux->pf_readdir = ReadDir; p_demux->pf_control = access_vaDirectoryControlHelper; msg_Dbg( p_demux, "using QuickTime Media Link reader" ); return VLC_SUCCESS; }
/***************************************************************************** * Import_IFO: main import function *****************************************************************************/ int Import_IFO( vlc_object_t *p_this ) { stream_t *p_stream = (stream_t *)p_this; CHECK_FILE(p_stream); if( !stream_HasExtension( p_stream, ".IFO" ) ) return VLC_EGENERIC; const char *psz_location = StreamLocation( p_stream ); if( psz_location == NULL ) return VLC_EGENERIC; size_t len = strlen( psz_location ); if( len < 12 ) return VLC_EGENERIC; const char *psz_probe; const char *psz_file = &psz_location[len - 12]; /* Valid filenames are : * - VIDEO_TS.IFO * - VTS_XX_X.IFO where X are digits */ if( !strncasecmp( psz_file, "VIDEO_TS", 8 ) || !strncasecmp( psz_file, "VTS_", 4 ) ) { psz_probe = "DVDVIDEO"; p_stream->pf_readdir = ReadDVD; } /* Valid filename for DVD-VR is VR_MANGR.IFO */ else if( !strncasecmp( psz_file, "VR_MANGR", 8 ) ) { psz_probe = "DVD_RTR_"; p_stream->pf_readdir = ReadDVD_VR; } else return VLC_EGENERIC; const uint8_t *p_peek; ssize_t i_peek = vlc_stream_Peek( p_stream->s, &p_peek, 8 ); if( i_peek < 8 || memcmp( p_peek, psz_probe, 8 ) ) return VLC_EGENERIC; p_stream->pf_control = access_vaDirectoryControlHelper; return VLC_SUCCESS; }
/***************************************************************************** * Import_PLS: main import function *****************************************************************************/ int Import_PLS( vlc_object_t *p_this ) { stream_t *p_demux = (stream_t *)p_this; const uint8_t *p_peek; CHECK_FILE(p_demux); if( vlc_stream_Peek( p_demux->p_source , &p_peek, 10 ) < 10 ) { msg_Dbg( p_demux, "not enough data" ); return VLC_EGENERIC; } if( strncasecmp( (const char *)p_peek, "[playlist]", 10 ) && strncasecmp( (const char *)p_peek, "[Reference]", 10 ) && !stream_HasExtension( p_demux, ".pls" ) ) return VLC_EGENERIC; msg_Dbg( p_demux, "found valid PLS playlist file"); p_demux->pf_readdir = ReadDir; p_demux->pf_control = access_vaDirectoryControlHelper; return VLC_SUCCESS; }