Commit 9e1f8a9e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

demux: rename psz_file to psz_filepath (refs #18504)

parent d9ce9c77
......@@ -51,7 +51,7 @@ struct demux_t
char *psz_access;
char *psz_demux;
char *psz_location;
char *psz_file;
char *psz_filepath;
union {
/**
......@@ -395,8 +395,8 @@ static inline void demux_UpdateTitleFromStream( demux_t *demux )
VLC_USED
static inline bool demux_IsPathExtension( demux_t *p_demux, const char *psz_extension )
{
const char *name = (p_demux->psz_file != NULL) ? p_demux->psz_file
: p_demux->psz_location;
const char *name = (p_demux->psz_filepath != NULL) ? p_demux->psz_filepath
: p_demux->psz_location;
const char *psz_ext = strrchr ( name, '.' );
if( !psz_ext || strcasecmp( psz_ext, psz_extension ) )
return false;
......
......@@ -643,11 +643,11 @@ static int blurayOpen(vlc_object_t *object)
}
} else if (!forced) {
if (!p_demux->psz_file) {
if (!p_demux->psz_filepath) {
return VLC_EGENERIC;
}
if (probeFile(p_demux->psz_file) != VLC_SUCCESS) {
if (probeFile(p_demux->psz_filepath) != VLC_SUCCESS) {
return VLC_EGENERIC;
}
}
......@@ -689,12 +689,12 @@ static int blurayOpen(vlc_object_t *object)
} else
#endif
{
if (!p_demux->psz_file) {
if (!p_demux->psz_filepath) {
/* no path provided (bluray://). use default DVD device. */
p_sys->psz_bd_path = var_InheritString(object, "dvd");
} else {
/* store current bd path */
p_sys->psz_bd_path = strdup(p_demux->psz_file);
p_sys->psz_bd_path = strdup(p_demux->psz_filepath);
}
/* If we're passed a block device, try to convert it to the mount point. */
......
......@@ -217,7 +217,7 @@ static int DemuxOpen(vlc_object_t *obj)
demux_t *demux = (demux_t *)obj;
unsigned track;
vcddev_t *dev = DiscOpen(obj, demux->psz_location, demux->psz_file,
vcddev_t *dev = DiscOpen(obj, demux->psz_location, demux->psz_filepath,
&track);
if (dev == NULL)
return VLC_EGENERIC;
......
......@@ -304,7 +304,7 @@ static int Open( vlc_object_t *obj )
es_format_t video_format, audio_format;
int retval;
if( !p_demux->psz_file )
if( !p_demux->psz_filepath )
return VLC_EGENERIC;
p_sys = new ( nothrow ) demux_sys_t();
......@@ -932,7 +932,7 @@ int dcpInit ( demux_t *p_demux )
demux_sys_t *p_sys = p_demux->p_sys;
dcp_t *p_dcp = p_sys->p_dcp;
p_dcp->path = p_demux->psz_file;
p_dcp->path = p_demux->psz_filepath;
/* Add a '/' in end of path if needed */
if ( *(p_dcp->path).rbegin() != '/')
p_dcp->path.append( "/" );
......
......@@ -347,7 +347,7 @@ static int AccessDemuxOpen ( vlc_object_t *p_this )
if( !strncmp(p_demux->psz_access, "dvd", 3) )
forced = true;
if( !p_demux->psz_file || !*p_demux->psz_file )
if( !p_demux->psz_filepath || !*p_demux->psz_filepath )
{
/* Only when selected */
if( !forced )
......@@ -356,7 +356,7 @@ static int AccessDemuxOpen ( vlc_object_t *p_this )
psz_file = var_InheritString( p_this, "dvd" );
}
else
psz_file = strdup( p_demux->psz_file );
psz_file = strdup( p_demux->psz_filepath );
#if defined( _WIN32 ) || defined( __OS2__ )
if( psz_file != NULL )
......
......@@ -166,7 +166,7 @@ static int Open( vlc_object_t *p_this )
char *psz_file;
ifo_handle_t *p_vmg_file;
if( !p_demux->psz_file || !*p_demux->psz_file )
if( !p_demux->psz_filepath || !*p_demux->psz_filepath )
{
/* Only when selected */
if( !*p_demux->psz_access )
......@@ -175,7 +175,7 @@ static int Open( vlc_object_t *p_this )
psz_file = var_InheritString( p_this, "dvd" );
}
else
psz_file = strdup( p_demux->psz_file );
psz_file = strdup( p_demux->psz_filepath );
#if defined( _WIN32 ) || defined( __OS2__ )
if( psz_file != NULL )
......
......@@ -175,8 +175,8 @@ int avformat_OpenDemux( vlc_object_t *p_this )
memcpy( pd.buf, peek, pd.buf_size );
memset( pd.buf + pd.buf_size, 0, AVPROBE_PADDING_SIZE );
if( p_demux->psz_file )
psz_url = strdup( p_demux->psz_file );
if( p_demux->psz_filepath )
psz_url = strdup( p_demux->psz_filepath );
else
{
if( asprintf( &psz_url, "%s://%s", p_demux->psz_access,
......@@ -243,22 +243,22 @@ int avformat_OpenDemux( vlc_object_t *p_this )
{
int i_len;
if( !p_demux->psz_file )
if( !p_demux->psz_filepath )
{
free( psz_url );
return VLC_EGENERIC;
}
i_len = strlen( p_demux->psz_file );
i_len = strlen( p_demux->psz_filepath );
if( i_len < 4 )
{
free( psz_url );
return VLC_EGENERIC;
}
if( strcasecmp( &p_demux->psz_file[i_len - 4], ".str" ) &&
strcasecmp( &p_demux->psz_file[i_len - 4], ".xai" ) &&
strcasecmp( &p_demux->psz_file[i_len - 3], ".xa" ) )
if( strcasecmp( &p_demux->psz_filepath[i_len - 4], ".str" ) &&
strcasecmp( &p_demux->psz_filepath[i_len - 4], ".xai" ) &&
strcasecmp( &p_demux->psz_filepath[i_len - 3], ".xa" ) )
{
free( psz_url );
return VLC_EGENERIC;
......
......@@ -157,11 +157,11 @@ static int Open( vlc_object_t * p_this )
{
msg_Dbg( p_demux, "Preloading local dir" );
/* get the files from the same dir from the same family (based on p_demux->psz_path) */
if ( p_demux->psz_file && !strcmp( p_demux->psz_access, "file" ) )
if ( p_demux->psz_filepath && !strcmp( p_demux->psz_access, "file" ) )
{
// assume it's a regular file
// get the directory path
s_path = p_demux->psz_file;
s_path = p_demux->psz_filepath;
if (s_path.at(s_path.length() - 1) == DIR_SEP_CHAR)
{
s_path = s_path.substr(0,s_path.length()-1);
......@@ -186,9 +186,9 @@ static int Open( vlc_object_t * p_this )
s_filename = s_path + DIR_SEP_CHAR + psz_file;
#if defined(_WIN32) || defined(__OS2__)
if (!strcasecmp(s_filename.c_str(), p_demux->psz_file))
if (!strcasecmp(s_filename.c_str(), p_demux->psz_filepath))
#else
if (!s_filename.compare(p_demux->psz_file))
if (!s_filename.compare(p_demux->psz_filepath))
#endif
{
continue; // don't reuse the original opened file
......
......@@ -143,7 +143,7 @@ static int Open( vlc_object_t *p_this )
/* We accept file based on extension match */
if( !p_demux->obj.force )
{
const char *psz_ext = p_demux->psz_file ? strrchr( p_demux->psz_file, '.' )
const char *psz_ext = p_demux->psz_filepath ? strrchr( p_demux->psz_filepath, '.' )
: NULL;
if( psz_ext )
psz_ext++;
......
......@@ -149,10 +149,10 @@ static int Open( vlc_object_t * p_this )
if( !p_demux->obj.force )
{
/* guess preset based on file extension */
if( !p_demux->psz_file )
if( !p_demux->psz_filepath )
return VLC_EGENERIC;
const char *psz_ext = strrchr( p_demux->psz_file, '.' );
const char *psz_ext = strrchr( p_demux->psz_filepath, '.' );
if( !psz_ext )
return VLC_EGENERIC;
psz_ext++;
......
......@@ -707,7 +707,7 @@ static int Open ( vlc_object_t *p_this )
es_format_Init( &fmt, SPU_ES, VLC_CODEC_SUBT );
/* Stupid language detection in the filename */
char * psz_language = get_language_from_filename( p_demux->psz_file );
char * psz_language = get_language_from_filename( p_demux->psz_filepath );
if( psz_language )
{
......
......@@ -221,7 +221,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
p_demux->psz_access = strdup( psz_access );
p_demux->psz_demux = strdup( psz_demux );
p_demux->psz_location = strdup( psz_location );
p_demux->psz_file = get_path( psz_location ); /* parse URL */
p_demux->psz_filepath = get_path( psz_location ); /* parse URL */
if( unlikely(p_demux->psz_access == NULL
|| p_demux->psz_demux == NULL
......@@ -232,7 +232,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
msg_Dbg( p_obj, "creating demux: access='%s' demux='%s' "
"location='%s' file='%s'",
p_demux->psz_access, p_demux->psz_demux,
p_demux->psz_location, p_demux->psz_file );
p_demux->psz_location, p_demux->psz_filepath );
p_demux->s = s;
p_demux->out = out;
......@@ -250,9 +250,9 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
{
const char *psz_module = NULL;
if( !strcmp( p_demux->psz_demux, "any" ) && p_demux->psz_file )
if( !strcmp( p_demux->psz_demux, "any" ) && p_demux->psz_filepath )
{
char const* psz_ext = strrchr( p_demux->psz_file, '.' );
char const* psz_ext = strrchr( p_demux->psz_filepath, '.' );
if( psz_ext )
psz_module = DemuxNameFromExtension( psz_ext + 1, b_preparsing );
......@@ -275,7 +275,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
return p_demux;
error:
free( p_demux->psz_file );
free( p_demux->psz_filepath );
free( p_demux->psz_location );
free( p_demux->psz_demux );
free( p_demux->psz_access );
......@@ -293,7 +293,7 @@ void demux_Delete( demux_t *p_demux )
module_unneed( p_demux, p_demux->p_module );
priv->destroy(p_demux);
free( p_demux->psz_file );
free( p_demux->psz_filepath );
free( p_demux->psz_location );
free( p_demux->psz_demux );
free( p_demux->psz_access );
......@@ -588,7 +588,7 @@ static demux_t *demux_FilterNew( demux_t *p_next, const char *p_name )
p_demux->psz_access = NULL;
p_demux->psz_demux = NULL;
p_demux->psz_location = NULL;
p_demux->psz_file = NULL;
p_demux->psz_filepath = NULL;
p_demux->out = NULL;
priv->destroy = demux_DestroyDemuxFilter;
p_demux->p_module =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment