mirror of https://code.videolan.org/videolan/vlc
input/access: add preparsing flag
This flag will be used to notify the access module that we are preparsing.
This commit is contained in:
parent
7658154c35
commit
bc8418f5be
|
@ -83,6 +83,7 @@ struct access_t
|
|||
char *psz_url; /**< Full URL or MRL */
|
||||
const char *psz_location; /**< Location (URL with the scheme stripped) */
|
||||
char *psz_filepath; /**< Local file path (if applicable) */
|
||||
bool b_preparsing; /**< True if this access is used to preparse */
|
||||
|
||||
/* pf_read/pf_block/pf_readdir is used to read data.
|
||||
* XXX A access should set one and only one of them */
|
||||
|
|
|
@ -61,7 +61,7 @@ char *get_path(const char *location)
|
|||
* access_New:
|
||||
*****************************************************************************/
|
||||
static access_t *access_New(vlc_object_t *parent, input_thread_t *input,
|
||||
const char *mrl)
|
||||
bool preparsing, const char *mrl)
|
||||
{
|
||||
char *redirv[MAX_REDIR];
|
||||
unsigned redirc = 0;
|
||||
|
@ -80,6 +80,7 @@ static access_t *access_New(vlc_object_t *parent, input_thread_t *input,
|
|||
access->pf_seek = NULL;
|
||||
access->pf_control = NULL;
|
||||
access->p_sys = NULL;
|
||||
access->b_preparsing = preparsing;
|
||||
access_InitFields(access);
|
||||
|
||||
if (unlikely(access->psz_url == NULL))
|
||||
|
@ -142,7 +143,7 @@ error:
|
|||
|
||||
access_t *vlc_access_NewMRL(vlc_object_t *parent, const char *mrl)
|
||||
{
|
||||
return access_New(parent, NULL, mrl);
|
||||
return access_New(parent, NULL, false, mrl);
|
||||
}
|
||||
|
||||
void vlc_access_Delete(access_t *access)
|
||||
|
@ -378,7 +379,7 @@ static void AStreamDestroy(stream_t *s)
|
|||
}
|
||||
|
||||
stream_t *stream_AccessNew(vlc_object_t *parent, input_thread_t *input,
|
||||
const char *url)
|
||||
bool preparsing, const char *url)
|
||||
{
|
||||
stream_t *s = stream_CommonNew(parent, AStreamDestroy);
|
||||
if (unlikely(s == NULL))
|
||||
|
@ -388,7 +389,7 @@ stream_t *stream_AccessNew(vlc_object_t *parent, input_thread_t *input,
|
|||
if (unlikely(sys == NULL))
|
||||
goto error;
|
||||
|
||||
sys->access = access_New(VLC_OBJECT(s), input, url);
|
||||
sys->access = access_New(VLC_OBJECT(s), input, preparsing, url);
|
||||
if (sys->access == NULL)
|
||||
goto error;
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ demux_t *input_DemuxNew( vlc_object_t *obj, const char *access_name,
|
|||
|
||||
if( likely(asprintf( &url, "%s://%s", access_name, path) >= 0) )
|
||||
{
|
||||
stream = stream_AccessNew( obj, input, url );
|
||||
stream = stream_AccessNew( obj, input, preparsing, url );
|
||||
free( url );
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ stream_t *stream_UrlNew( vlc_object_t *p_parent, const char *psz_url )
|
|||
if( !psz_url )
|
||||
return NULL;
|
||||
|
||||
stream_t *s = stream_AccessNew( p_parent, NULL, psz_url );
|
||||
stream_t *s = stream_AccessNew( p_parent, NULL, false, psz_url );
|
||||
if( s == NULL )
|
||||
msg_Err( p_parent, "no suitable access module for `%s'", psz_url );
|
||||
return s;
|
||||
|
|
|
@ -35,7 +35,7 @@ void stream_CommonDelete( stream_t *s );
|
|||
/**
|
||||
* This function creates a stream_t with an access_t back-end.
|
||||
*/
|
||||
stream_t *stream_AccessNew(vlc_object_t *, input_thread_t *, const char *);
|
||||
stream_t *stream_AccessNew(vlc_object_t *, input_thread_t *, bool, const char *);
|
||||
|
||||
/**
|
||||
* This function creates a new stream_t filter.
|
||||
|
|
Loading…
Reference in New Issue