Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
c6274d04
Commit
c6274d04
authored
Jul 26, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream: fold psz_access and psz_path into psz_url
parent
f5375e68
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
57 additions
and
61 deletions
+57
-61
include/vlc_stream.h
include/vlc_stream.h
+1
-3
modules/access/archive/stream.c
modules/access/archive/stream.c
+2
-2
modules/access/rar/rar.c
modules/access/rar/rar.c
+6
-8
modules/access/rar/stream.c
modules/access/rar/stream.c
+4
-9
modules/access/zip/zipstream.c
modules/access/zip/zipstream.c
+16
-11
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
+1
-1
modules/demux/image.c
modules/demux/image.c
+1
-1
modules/stream_filter/hds/hds.c
modules/stream_filter/hds/hds.c
+4
-6
modules/stream_filter/smooth/smooth.c
modules/stream_filter/smooth/smooth.c
+3
-3
src/input/input.c
src/input/input.c
+7
-3
src/input/stream.c
src/input/stream.c
+2
-4
src/input/stream_access.c
src/input/stream_access.c
+4
-3
src/input/stream_demux.c
src/input/stream_demux.c
+2
-2
src/input/stream_filter.c
src/input/stream_filter.c
+2
-3
src/input/stream_memory.c
src/input/stream_memory.c
+2
-2
No files found.
include/vlc_stream.h
View file @
c6274d04
...
...
@@ -51,9 +51,7 @@ struct stream_t
/* Module properties for stream filter */
module_t
*
p_module
;
char
*
psz_access
;
/* Real or virtual path (it can only be changed during stream_t opening) */
char
*
psz_path
;
char
*
psz_url
;
/* Stream source for stream filter */
stream_t
*
p_source
;
...
...
modules/access/archive/stream.c
View file @
c6274d04
...
...
@@ -142,8 +142,8 @@ static input_item_t *Browse(stream_t *p_stream)
{
char
*
psz_uri
=
NULL
;
char
*
psz_access_uri
=
NULL
;
int
i_ret
=
asprintf
(
&
psz_access_uri
,
"%s
://%s%c%s"
,
p_stream
->
psz_access
,
p_stream
->
psz_path
,
ARCHIVE_SEP_CHAR
,
archive_entry_pathname
(
p_entry
));
int
i_ret
=
asprintf
(
&
psz_access_uri
,
"%s
%c%s"
,
p_stream
->
psz_url
,
ARCHIVE_SEP_CHAR
,
archive_entry_pathname
(
p_entry
));
if
(
i_ret
==
-
1
)
return
NULL
;
i_ret
=
asprintf
(
&
psz_uri
,
"archive://%s"
,
psz_access_uri
);
...
...
modules/access/rar/rar.c
View file @
c6274d04
...
...
@@ -317,12 +317,11 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file, unsigned int *pi_nbvol
*
file
=
NULL
;
*
pi_nbvols
=
1
;
const
rar_pattern_t
*
pattern
=
FindVolumePattern
(
s
->
psz_
path
,
b_extonly
);
const
rar_pattern_t
*
pattern
=
FindVolumePattern
(
s
->
psz_
url
,
b_extonly
);
int
volume_offset
=
0
;
char
*
volume_mrl
;
if
(
asprintf
(
&
volume_mrl
,
"%s://%s"
,
s
->
psz_access
,
s
->
psz_path
)
<
0
)
char
*
volume_mrl
=
strdup
(
s
->
psz_url
);
if
(
volume_mrl
==
NULL
)
return
VLC_EGENERIC
;
stream_t
*
vol
=
s
;
...
...
@@ -374,10 +373,9 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file, unsigned int *pi_nbvol
if
(
volume_index
>
pattern
->
stop
)
return
VLC_SUCCESS
;
char
*
volume_base
;
if
(
asprintf
(
&
volume_base
,
"%s://%.*s"
,
s
->
psz_access
,
(
int
)(
strlen
(
s
->
psz_path
)
-
strlen
(
pattern
->
match
)),
s
->
psz_path
)
<
0
)
char
*
volume_base
=
strndup
(
s
->
psz_url
,
strlen
(
s
->
psz_url
)
-
strlen
(
pattern
->
match
));
if
(
volume_base
==
NULL
)
return
VLC_SUCCESS
;
if
(
pattern
->
start
)
{
...
...
modules/access/rar/stream.c
View file @
c6274d04
...
...
@@ -104,13 +104,8 @@ int RarStreamOpen(vlc_object_t *object)
* Reusing WriteXSPF from the zip access is probably a good idea
* (becareful about '\' and '/'.
*/
char
*
mrl
;
if
(
asprintf
(
&
mrl
,
"%s://%s"
,
s
->
psz_access
,
s
->
psz_path
)
<
0
)
mrl
=
NULL
;
char
*
base
;
char
*
encoded
=
mrl
?
encode_URI_component
(
mrl
)
:
NULL
;
free
(
mrl
);
char
*
encoded
=
encode_URI_component
(
s
->
psz_url
);
if
(
!
encoded
||
asprintf
(
&
base
,
"rar://%s"
,
encoded
)
<
0
)
base
=
NULL
;
free
(
encoded
);
...
...
@@ -150,12 +145,12 @@ int RarStreamOpen(vlc_object_t *object)
sys
->
payload
=
payload
;
char
*
tmp
;
if
(
asprintf
(
&
tmp
,
"%s.m3u"
,
s
->
psz_
path
)
<
0
)
{
if
(
asprintf
(
&
tmp
,
"%s.m3u"
,
s
->
psz_
url
)
<
0
)
{
RarStreamClose
(
object
);
return
VLC_ENOMEM
;
}
free
(
s
->
psz_
path
);
s
->
psz_
path
=
tmp
;
free
(
s
->
psz_
url
);
s
->
psz_
url
=
tmp
;
return
VLC_SUCCESS
;
}
...
...
modules/access/zip/zipstream.c
View file @
c6274d04
...
...
@@ -185,10 +185,7 @@ int StreamOpen( vlc_object_t *p_this )
p_sys
->
fileFunctions
=
(
zlib_filefunc_def
*
)
calloc
(
1
,
sizeof
(
zlib_filefunc_def
)
);
if
(
!
p_sys
->
fileFunctions
)
{
free
(
p_sys
);
return
VLC_ENOMEM
;
}
goto
error
;
p_sys
->
fileFunctions
->
zopen_file
=
ZipIO_Open
;
p_sys
->
fileFunctions
->
zread_file
=
ZipIO_Read
;
p_sys
->
fileFunctions
->
zwrite_file
=
ZipIO_Write
;
...
...
@@ -202,23 +199,31 @@ int StreamOpen( vlc_object_t *p_this )
{
msg_Warn
(
s
,
"unable to open file"
);
free
(
p_sys
->
fileFunctions
);
free
(
p_sys
);
return
VLC_EGENERIC
;
goto
error
;
}
/* Find the stream uri */
const
char
*
p
=
strstr
(
s
->
psz_url
,
"://"
);
p_sys
->
psz_path
=
strdup
(
p
?
p
+
3
:
""
);
char
*
psz_tmp
;
if
(
asprintf
(
&
psz_tmp
,
"%s.xspf"
,
s
->
psz_path
)
==
-
1
)
if
(
asprintf
(
&
psz_tmp
,
"%s.xspf"
,
s
->
psz_url
)
==
-
1
)
psz_tmp
=
NULL
;
if
(
p_sys
->
psz_path
==
NULL
||
psz_tmp
==
NULL
)
{
free
(
psz_tmp
);
free
(
p_sys
->
psz_path
);
free
(
p_sys
->
fileFunctions
);
free
(
p_sys
);
return
VLC_ENOMEM
;
}
p_sys
->
psz_path
=
s
->
psz_path
;
s
->
psz_
path
=
psz_tmp
;
free
(
s
->
psz_url
)
;
s
->
psz_
url
=
psz_tmp
;
s
->
pf_read
=
Read
;
s
->
pf_control
=
Control
;
return
VLC_SUCCESS
;
error:
free
(
p_sys
);
return
VLC_ENOMEM
;
}
/** *************************************************************************
...
...
modules/demux/adaptative/playlist/AbstractPlaylist.cpp
View file @
c6274d04
...
...
@@ -78,7 +78,7 @@ Url AbstractPlaylist::getUrlSegment() const
else
{
std
::
stringstream
ss
;
ss
<<
stream
->
psz_access
<<
"://"
<<
Helper
::
getDirectoryPath
(
stream
->
psz_path
)
<<
"/"
;
ss
<<
Helper
::
getDirectoryPath
(
stream
->
psz_url
)
<<
"/"
;
return
Url
(
ss
.
str
());
}
}
...
...
modules/demux/image.c
View file @
c6274d04
...
...
@@ -437,7 +437,7 @@ static bool FindSVGmarker(int *position, const uint8_t *data, const int size, co
static
bool
IsSVG
(
stream_t
*
s
)
{
char
*
ext
=
strstr
(
s
->
psz_
path
,
".svg"
);
char
*
ext
=
strstr
(
s
->
psz_
url
,
".svg"
);
if
(
!
ext
)
return
false
;
const
uint8_t
*
header
;
...
...
modules/stream_filter/hds/hds.c
View file @
c6274d04
...
...
@@ -1631,17 +1631,15 @@ static int Open( vlc_object_t *p_this )
if
(
!
isHDS
(
s
)
)
return
VLC_EGENERIC
;
msg_Info
(
p_this
,
"HTTP Dynamic Streaming (%s)"
,
s
->
psz_
path
);
msg_Info
(
p_this
,
"HTTP Dynamic Streaming (%s)"
,
s
->
psz_
url
);
s
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
*
p_sys
)
);
if
(
unlikely
(
p_sys
==
NULL
)
)
return
VLC_ENOMEM
;
char
*
uri_without_query
=
NULL
;
size_t
pathlen
=
strcspn
(
s
->
psz_path
,
"?"
);
if
(
unlikely
(
(
pathlen
>
INT_MAX
)
||
(
asprintf
(
&
uri_without_query
,
"%s://%.*s"
,
s
->
psz_access
,
(
int
)
pathlen
,
s
->
psz_path
)
<
0
)
)
)
char
*
uri_without_query
=
strndup
(
s
->
psz_url
,
strcspn
(
s
->
psz_url
,
"?"
)
);
if
(
uri_without_query
==
NULL
)
{
free
(
p_sys
);
return
VLC_ENOMEM
;
...
...
modules/stream_filter/smooth/smooth.c
View file @
c6274d04
...
...
@@ -462,14 +462,14 @@ static int Open( vlc_object_t *p_this )
if
(
!
isSmoothStreaming
(
s
)
)
return
VLC_EGENERIC
;
msg_Info
(
p_this
,
"Smooth Streaming (%s)"
,
s
->
psz_
path
);
msg_Info
(
p_this
,
"Smooth Streaming (%s)"
,
s
->
psz_
url
);
s
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
*
p_sys
)
);
if
(
unlikely
(
p_sys
==
NULL
)
)
return
VLC_ENOMEM
;
char
*
uri
=
NULL
;
if
(
unlikely
(
asprintf
(
&
uri
,
"%s://%s"
,
s
->
psz_access
,
s
->
psz_path
)
<
0
)
)
char
*
uri
=
strdup
(
s
->
psz_url
)
;
if
(
unlikely
(
uri
==
NULL
)
)
{
free
(
p_sys
);
return
VLC_ENOMEM
;
...
...
src/input/input.c
View file @
c6274d04
...
...
@@ -2341,10 +2341,14 @@ static int InputSourceInit( input_thread_t *p_input,
stream_Control
(
p_stream
,
STREAM_GET_PTS_DELAY
,
&
i_pts_delay
);
}
if
(
p_stream
->
psz_url
!=
NULL
)
/* Take access/stream redirections into account: */
psz_path
=
strstr
(
p_stream
->
psz_url
,
"://"
);
if
(
psz_path
==
NULL
)
psz_path
=
""
;
in
->
p_demux
=
demux_New
(
p_input
,
p_input
,
psz_access
,
psz_demux
,
/* Take access/stream redirections into account: */
p_stream
->
psz_path
?
p_stream
->
psz_path
:
psz_path
,
p_stream
,
p_input
->
p
->
p_es_out
,
psz_path
,
p_stream
,
p_input
->
p
->
p_es_out
,
p_input
->
b_preparsing
);
if
(
in
->
p_demux
==
NULL
)
...
...
src/input/stream.c
View file @
c6274d04
...
...
@@ -63,8 +63,7 @@ stream_t *stream_CommonNew(vlc_object_t *parent)
stream_t
*
s
=
&
priv
->
stream
;
s
->
psz_access
=
NULL
;
s
->
psz_path
=
NULL
;
s
->
psz_url
=
NULL
;
priv
->
peek
=
NULL
;
/* UTF16 and UTF32 text file conversion */
...
...
@@ -88,8 +87,7 @@ void stream_CommonDelete( stream_t *s )
if
(
priv
->
peek
!=
NULL
)
block_Release
(
priv
->
peek
);
free
(
s
->
psz_access
);
free
(
s
->
psz_path
);
free
(
s
->
psz_url
);
vlc_object_release
(
s
);
}
...
...
src/input/stream_access.c
View file @
c6274d04
...
...
@@ -194,10 +194,11 @@ stream_t *stream_AccessNew( access_t *p_access )
return
NULL
;
s
->
p_input
=
p_access
->
p_input
;
s
->
psz_access
=
strdup
(
p_access
->
psz_access
);
s
->
psz_path
=
strdup
(
p_access
->
psz_location
);
if
(
asprintf
(
&
s
->
psz_url
,
"%s://%s"
,
p_access
->
psz_access
,
p_access
->
psz_location
)
==
-
1
)
s
->
psz_url
=
NULL
;
s
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
!
s
->
psz_
access
||
!
s
->
psz_path
||
!
s
->
p_sys
)
if
(
!
s
->
psz_
url
||
!
s
->
p_sys
)
{
stream_CommonDelete
(
s
);
return
NULL
;
...
...
src/input/stream_demux.c
View file @
c6274d04
...
...
@@ -74,13 +74,13 @@ stream_t *stream_DemuxNew( demux_t *p_demux, const char *psz_demux, es_out_t *ou
if
(
s
==
NULL
)
return
NULL
;
s
->
p_input
=
p_demux
->
p_input
;
s
->
psz_
path
=
strdup
(
""
);
/* N/A */
s
->
psz_
url
=
strdup
(
""
);
/* N/A */
s
->
pf_read
=
DStreamRead
;
s
->
pf_control
=
DStreamControl
;
s
->
pf_destroy
=
DStreamDelete
;
s
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
!
s
->
psz_
path
||
!
s
->
p_sys
)
if
(
!
s
->
psz_
url
||
!
s
->
p_sys
)
{
free
(
p_sys
);
stream_CommonDelete
(
s
);
...
...
src/input/stream_filter.c
View file @
c6274d04
...
...
@@ -49,9 +49,8 @@ stream_t *stream_FilterNew( stream_t *p_source,
s
->
p_input
=
p_source
->
p_input
;
/* */
s
->
psz_access
=
strdup
(
p_source
->
psz_access
);
s
->
psz_path
=
strdup
(
p_source
->
psz_path
);
if
(
!
s
->
psz_path
)
s
->
psz_url
=
strdup
(
p_source
->
psz_url
);
if
(
unlikely
(
s
->
psz_url
==
NULL
)
)
{
stream_CommonDelete
(
s
);
return
NULL
;
...
...
src/input/stream_memory.c
View file @
c6274d04
...
...
@@ -59,9 +59,9 @@ stream_t *stream_MemoryNew( vlc_object_t *p_this, uint8_t *p_buffer,
if
(
!
s
)
return
NULL
;
s
->
psz_
path
=
strdup
(
""
);
/* N/A */
s
->
psz_
url
=
strdup
(
""
);
/* N/A */
s
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
stream_sys_t
)
);
if
(
!
s
->
psz_
path
||
!
s
->
p_sys
)
if
(
!
s
->
psz_
url
||
!
s
->
p_sys
)
{
stream_CommonDelete
(
s
);
free
(
p_sys
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment