X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Finput%2Faccess.c;h=b8080b7ce66c62839ecc48dc73d0abc5ed381ae1;hb=031e7a2d7288934c46192f0363345d9e230ee3e5;hp=394bf9814ef879bd59af347fd78864d1e295906d;hpb=2cb472dba008f7d877ffe6bae9c5575253365282;p=vlc diff --git a/src/input/access.c b/src/input/access.c index 394bf9814e..b8080b7ce6 100644 --- a/src/input/access.c +++ b/src/input/access.c @@ -21,17 +21,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include -#include #include "input_internal.h" /***************************************************************************** * access2_InternalNew: *****************************************************************************/ -static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access, - char *psz_demux, char *psz_path, +static access_t *access2_InternalNew( vlc_object_t *p_obj, const char *psz_access, + const char *psz_demux, const char *psz_path, access_t *p_source, vlc_bool_t b_quick ) { access_t *p_access = vlc_object_create( p_obj, VLC_OBJECT_ACCESS ); @@ -54,8 +56,16 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access, else { p_access->psz_path = strdup( psz_path ); - p_access->psz_access = - b_quick ? strdup( "file" ) : strdup( psz_access ); + if( b_quick ) + { + if( strncmp( psz_path, "file://", 7 ) == 0 ) + p_access->psz_access = strdup( "" ); + else + p_access->psz_access = strdup( "file" ); + } + else + p_access->psz_access = strdup( psz_access ); + p_access->psz_demux = strdup( psz_demux ); if( !b_quick ) @@ -83,17 +93,17 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access, if( p_source ) { p_access->p_module = - module_Need( p_access, "access_filter", psz_access, VLC_FALSE ); + module_Need( p_access, "access_filter", psz_access, VLC_TRUE ); } else { p_access->p_module = - module_Need( p_access, "access2", p_access->psz_access, - b_quick ? VLC_TRUE : VLC_FALSE ); + module_Need( p_access, "access2", p_access->psz_access, VLC_TRUE ); } if( p_access->p_module == NULL ) { + msg_StackAdd( "could not create access" ); vlc_object_detach( p_access ); free( p_access->psz_access ); free( p_access->psz_path ); @@ -108,8 +118,8 @@ static access_t *access2_InternalNew( vlc_object_t *p_obj, char *psz_access, /***************************************************************************** * access2_New: *****************************************************************************/ -access_t *__access2_New( vlc_object_t *p_obj, char *psz_access, - char *psz_demux, char *psz_path, vlc_bool_t b_quick ) +access_t *__access2_New( vlc_object_t *p_obj, const char *psz_access, + const char *psz_demux, const char *psz_path, vlc_bool_t b_quick ) { return access2_InternalNew( p_obj, psz_access, psz_demux, psz_path, NULL, b_quick ); @@ -118,7 +128,7 @@ access_t *__access2_New( vlc_object_t *p_obj, char *psz_access, /***************************************************************************** * access2_FilterNew: *****************************************************************************/ -access_t *access2_FilterNew( access_t *p_source, char *psz_access_filter ) +access_t *access2_FilterNew( access_t *p_source, const char *psz_access_filter ) { return access2_InternalNew( VLC_OBJECT(p_source), psz_access_filter, NULL, NULL, p_source, VLC_FALSE );