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
782865e8
Commit
782865e8
authored
Jul 08, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: simplify with demux psz_location
parent
86805ce1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
25 deletions
+9
-25
modules/demux/playlist/playlist.c
modules/demux/playlist/playlist.c
+9
-25
No files found.
modules/demux/playlist/playlist.c
View file @
782865e8
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#ifdef WIN32
#ifdef WIN32
# include <ctype.h>
# include <ctype.h>
#endif
#endif
#include <assert.h>
#include "playlist.h"
#include "playlist.h"
...
@@ -167,34 +168,17 @@ input_item_t * GetCurrentItem(demux_t *p_demux)
...
@@ -167,34 +168,17 @@ input_item_t * GetCurrentItem(demux_t *p_demux)
*/
*/
char
*
FindPrefix
(
demux_t
*
p_demux
)
char
*
FindPrefix
(
demux_t
*
p_demux
)
{
{
char
*
psz_file
;
char
*
psz_url
;
char
*
psz_prefix
;
char
*
psz_path
;
if
(
p_demux
->
psz_access
)
{
if
(
asprintf
(
&
psz_path
,
"%s://%s"
,
p_demux
->
psz_access
,
p_demux
->
psz_location
)
==
-
1
)
return
NULL
;
}
else
{
psz_path
=
strdup
(
p_demux
->
psz_location
);
if
(
psz_path
==
NULL
)
return
NULL
;
}
#ifdef WIN32
if
(
asprintf
(
&
psz_url
,
"%s://%s"
,
p_demux
->
psz_access
,
psz_file
=
strrchr
(
psz_path
,
'\\'
);
p_demux
->
psz_location
)
==
-
1
)
if
(
!
psz_file
)
return
NULL
;
#endif
psz_file
=
strrchr
(
psz_path
,
'/'
);
if
(
psz_file
)
char
*
psz_file
=
strrchr
(
psz_url
,
'/'
);
psz_prefix
=
strndup
(
psz_path
,
psz_file
-
psz_path
+
1
);
assert
(
psz_file
!=
NULL
);
else
psz_file
[
1
]
=
'\0'
;
psz_prefix
=
strdup
(
""
);
free
(
psz_path
);
return
psz_
prefix
;
return
psz_
url
;
}
}
/**
/**
...
...
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