Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
1ba7797b
Commit
1ba7797b
authored
May 26, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wpl/zpl: really compile the modules and fixe some issues.
(still some issues that I will fixe later on)
parent
c790b667
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
129 deletions
+103
-129
modules/demux/playlist/Modules.am
modules/demux/playlist/Modules.am
+14
-12
modules/demux/playlist/playlist.c
modules/demux/playlist/playlist.c
+12
-0
modules/demux/playlist/playlist.h
modules/demux/playlist/playlist.h
+6
-0
modules/demux/playlist/wpl.c
modules/demux/playlist/wpl.c
+15
-21
modules/demux/playlist/zpl.c
modules/demux/playlist/zpl.c
+56
-96
No files found.
modules/demux/playlist/Modules.am
View file @
1ba7797b
SOURCES_playlist = \
playlist.c \
playlist.h \
m3u.c \
ram.c \
asx.c \
b4s.c \
pls.c \
dvb.c \
podcast.c \
xspf.c \
xspf.h \
shoutcast.c \
asx.c \
sgimb.c \
qtl.c \
gvp.c \
ifo.c \
itml.c \
itml.h \
m3u.c \
playlist.c \
playlist.h \
pls.c \
podcast.c \
qtl.c \
ram.c \
sgimb.c \
shoutcast.c \
wpl.c \
xspf.c \
xspf.h \
zpl.c \
$(NULL)
libvlc_LTLIBRARIES += libplaylist_plugin.la
modules/demux/playlist/playlist.c
View file @
1ba7797b
...
...
@@ -151,6 +151,18 @@ vlc_module_begin ()
add_shortcut
(
"itml"
)
set_capability
(
"demux"
,
10
)
set_callbacks
(
Import_iTML
,
Close_iTML
)
add_submodule
()
set_description
(
N_
(
"WPL playlist"
)
)
add_shortcut
(
"playlist"
)
add_shortcut
(
"wpl"
)
set_capability
(
"demux"
,
10
)
set_callbacks
(
Import_WPL
,
Close_WPL
)
add_submodule
()
set_description
(
N_
(
"ZPL playlist"
)
)
add_shortcut
(
"playlist"
)
add_shortcut
(
"zpl"
)
set_capability
(
"demux"
,
10
)
set_callbacks
(
Import_ZPL
,
Close_ZPL
)
vlc_module_end
()
...
...
modules/demux/playlist/playlist.h
View file @
1ba7797b
...
...
@@ -76,6 +76,12 @@ void Close_VideoPortal ( vlc_object_t * );
int
Import_iTML
(
vlc_object_t
*
);
void
Close_iTML
(
vlc_object_t
*
);
int
Import_WPL
(
vlc_object_t
*
);
void
Close_WPL
(
vlc_object_t
*
);
int
Import_ZPL
(
vlc_object_t
*
);
void
Close_ZPL
(
vlc_object_t
*
);
#define INIT_PLAYLIST_STUFF \
input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
input_item_t *p_current_input = input_GetItem( p_input_thread );
...
...
modules/demux/playlist/wpl.c
View file @
1ba7797b
...
...
@@ -101,31 +101,28 @@ static int Demux( demux_t *p_demux )
while
(
psz_line
)
{
psz_parse
=
psz_line
;
/* Skip leading tabs and spaces */
while
(
*
psz_parse
==
' '
||
*
psz_parse
==
'\t'
||
*
psz_parse
==
'\n'
||
*
psz_parse
==
'\r'
)
psz_parse
++
;
*
psz_parse
==
'\n'
||
*
psz_parse
==
'\r'
)
psz_parse
++
;
if
(
!
strncasecmp
(
psz_parse
,
"<media src=
\"
"
,
sizeof
(
"<media src=
\"
"
)
-
1
)
)
/*if the line is uri of media item*/
/* if the line is the uri of the media item */
if
(
!
strncasecmp
(
psz_parse
,
"<media src=
\"
"
,
strlen
(
"<media src=
\"
"
)
)
)
{
psz_uri
=
ParseUriValue
(
psz_parse
);
if
(
psz_uri
&&
*
psz_uri
)
if
(
!
EMPTY_STR
(
psz_uri
)
)
{
psz_uri
=
ProcessMRL
(
psz_uri
,
p_demux
->
p_sys
->
psz_prefix
);
MaybeFromLocaleRep
(
&
psz_uri
);
p_input
=
input_item_NewExt
(
p_demux
,
psz_uri
,
psz_uri
,
0
,
NULL
,
0
,
-
1
);
input_item_AddSubItem
(
p_current_input
,
p_input
);
p_input
=
NULL
;
free
(
psz_uri
);
}
free
(
psz_uri
);
}
free
(
psz_line
);
psz_line
=
NULL
;
/* Fetch another line */
free
(
psz_line
);
psz_line
=
stream_ReadLine
(
p_demux
->
s
);
}
...
...
@@ -140,21 +137,18 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return
VLC_EGENERIC
;
}
static
char
*
ParseUriValue
(
char
*
psz_string
)
static
char
*
ParseUriValue
(
char
*
psz_string
)
{
int
i_len
=
strlen
(
psz_string
);
if
(
i_len
<=
3
)
if
(
i_len
<=
3
)
return
NULL
;
char
*
psz_value
=
(
char
*
)
malloc
(
i_len
);
if
(
!
psz_value
)
char
*
psz_value
=
calloc
(
i_len
,
1
);
if
(
!
psz_value
)
return
NULL
;
memset
(
psz_value
,
0
,
i_len
);
sscanf
(
psz_string
,
"%*[^=]=
\"
%[^
\0\r\t\n\"
]"
,
psz_value
);
if
(
strlen
(
psz_value
)
)
sscanf
(
psz_string
,
"%*[^=]=
\"
%[^
\r\t\n\"
]"
,
psz_value
);
return
psz_value
;
free
(
psz_value
);
return
NULL
;
}
modules/demux/playlist/zpl.c
View file @
1ba7797b
...
...
@@ -2,7 +2,6 @@
* zpl.c : ZPL playlist format import
*****************************************************************************
* Copyright (C) 2009 the VideoLAN team
*
* Authors: Su Heaven <suheaven@gmail.com>
*
...
...
@@ -65,39 +64,6 @@ int Import_ZPL( vlc_object_t *p_this )
return
VLC_SUCCESS
;
}
static
bool
ContainsURL
(
demux_t
*
p_demux
)
{
const
uint8_t
*
p_peek
,
*
p_peek_end
;
int
i_peek
;
i_peek
=
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
1024
);
if
(
i_peek
<=
0
)
return
false
;
p_peek_end
=
p_peek
+
i_peek
;
while
(
p_peek
+
sizeof
(
"https://"
)
<
p_peek_end
)
{
/* One line starting with an URL is enough */
if
(
!
strncasecmp
(
(
const
char
*
)
p_peek
,
"http://"
,
7
)
||
!
strncasecmp
(
(
const
char
*
)
p_peek
,
"mms://"
,
6
)
||
!
strncasecmp
(
(
const
char
*
)
p_peek
,
"rtsp://"
,
7
)
||
!
strncasecmp
(
(
const
char
*
)
p_peek
,
"https://"
,
8
)
||
!
strncasecmp
(
(
const
char
*
)
p_peek
,
"ftp://"
,
6
)
)
{
return
true
;
}
/* Comments and blank lines are ignored */
else
if
(
*
p_peek
!=
'#'
&&
*
p_peek
!=
'\n'
&&
*
p_peek
!=
'\r'
)
{
return
false
;
}
while
(
p_peek
<
p_peek_end
&&
*
p_peek
!=
'\n'
)
p_peek
++
;
if
(
*
p_peek
==
'\n'
)
p_peek
++
;
}
return
false
;
}
/*****************************************************************************
* Deactivate: frees unused data
...
...
@@ -124,8 +90,6 @@ static inline void MaybeFromLocaleRep (char **str)
static
int
Demux
(
demux_t
*
p_demux
)
{
char
*
psz_line
;
char
*
psz_name
=
NULL
;
char
*
psz_artist
=
NULL
;
char
*
psz_tabvalue
=
NULL
;
int
i_parsed_duration
=
0
;
mtime_t
i_duration
=
-
1
;
...
...
@@ -138,8 +102,11 @@ static int Demux( demux_t *p_demux )
/* Skip leading tabs and spaces */
while
(
*
psz_parse
==
' '
||
*
psz_parse
==
'\t'
||
*
psz_parse
==
'\n'
||
*
psz_parse
==
'\r'
)
psz_parse
++
;
if
(
!
strncasecmp
(
psz_parse
,
"AC"
,
sizeof
(
"AC"
)
-
1
)
)
/*if the 1st line is "AC"*/
*
psz_parse
==
'\n'
||
*
psz_parse
==
'\r'
)
psz_parse
++
;
/* if the 1st line is "AC", skip it */
if
(
!
strncasecmp
(
psz_parse
,
"AC"
,
strlen
(
"AC"
)
)
)
{
free
(
psz_line
);
psz_line
=
stream_ReadLine
(
p_demux
->
s
);
...
...
@@ -151,176 +118,172 @@ static int Demux( demux_t *p_demux )
/* Skip leading tabs and spaces */
while
(
*
psz_parse
==
' '
||
*
psz_parse
==
'\t'
||
*
psz_parse
==
'\n'
||
*
psz_parse
==
'\r'
)
psz_parse
++
;
*
psz_parse
==
'\n'
||
*
psz_parse
==
'\r'
)
psz_parse
++
;
if
(
!
strncasecmp
(
psz_parse
,
"NM"
,
s
izeof
(
"NM"
)
-
1
)
)
/*if the line is "NM"*/
if
(
!
strncasecmp
(
psz_parse
,
"NM"
,
s
trlen
(
"NM"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
char
*
psz_mrl
=
ProcessMRL
(
psz_tabvalue
,
p_demux
->
p_sys
->
psz_prefix
);
if
(
psz_mrl
)
{
psz_tabvalue
=
ProcessMRL
(
psz_tabvalue
,
p_demux
->
p_sys
->
psz_prefix
);
MaybeFromLocaleRep
(
&
psz_tabvalue
);
p_input
=
input_item_NewExt
(
p_demux
,
psz_tabvalue
,
psz_tabvalue
,
MaybeFromLocaleRep
(
&
psz_mrl
);
p_input
=
input_item_NewExt
(
p_demux
,
psz_mrl
,
psz_tabvalue
,
0
,
NULL
,
0
,
i_duration
);
free
(
psz_mrl
);
}
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"DR"
,
s
izeof
(
"DR"
)
-
1
)
)
/*if the line is "DR"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"DR"
,
s
trlen
(
"DR"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
i_parsed_duration
=
atoi
(
psz_tabvalue
);
if
(
i_parsed_duration
>=
0
)
{
i_duration
=
i_parsed_duration
*
INT64_C
(
1000
);
if
(
p_input
)
input_item_SetDuration
(
p_input
,
i_duration
);
input_item_SetDuration
(
p_input
,
i_duration
);
}
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TT"
,
s
izeof
(
"TT"
)
-
1
)
)
/*if the line is "TT"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TT"
,
s
trlen
(
"TT"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetTitle
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TG"
,
s
izeof
(
"TG"
)
-
1
)
)
/*if the line is "TG"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TG"
,
s
trlen
(
"TG"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetGenre
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TR"
,
s
izeof
(
"TR"
)
-
1
)
)
/*if the line is "TR"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TR"
,
s
trlen
(
"TR"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
int
tracNum
=
atoi
(
psz_tabvalue
);
if
(
p_input
)
input_item_SetTrackNum
(
p_input
,
tracNum
);
input_item_SetTrackNum
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TL"
,
s
izeof
(
"TL"
)
-
1
)
)
/*if the line is "TL"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TL"
,
s
trlen
(
"TL"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetLanguage
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TA"
,
s
izeof
(
"TA"
)
-
1
)
)
/*if the line is "TA"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TA"
,
s
trlen
(
"TA"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetArtist
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TB"
,
s
izeof
(
"TB"
)
-
1
)
)
/*if the line is "TB"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TB"
,
s
trlen
(
"TB"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetAlbum
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TY"
,
s
izeof
(
"TY"
)
-
1
)
)
/*if the line is "TY"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TY"
,
s
trlen
(
"TY"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetDate
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TH"
,
s
izeof
(
"TH"
)
-
1
)
)
/*if the line is "TH"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TH"
,
s
trlen
(
"TH"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetPublisher
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TE"
,
s
izeof
(
"TE"
)
-
1
)
)
/*if the line is "TE"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TE"
,
s
trlen
(
"TE"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetEncodedBy
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TC"
,
s
izeof
(
"TC"
)
-
1
)
)
/*if the line is "TC"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TC"
,
s
trlen
(
"TC"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetDescription
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TU"
,
s
izeof
(
"TU"
)
-
1
)
)
/*if the line is "TU"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TU"
,
s
trlen
(
"TU"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetURL
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"TO"
,
s
izeof
(
"TO"
)
-
1
)
)
/*if the line is "TO"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"TO"
,
s
trlen
(
"TO"
)
)
)
{
psz_tabvalue
=
ParseTabValue
(
psz_parse
);
if
(
psz_tabvalue
&&
*
psz_tabvalue
)
if
(
!
EMPTY_STR
(
psz_tabvalue
)
)
{
if
(
p_input
)
input_item_SetCopyright
(
p_input
,
psz_tabvalue
);
}
}
else
if
(
!
strncasecmp
(
psz_parse
,
"FD"
,
sizeof
(
"FD"
)
-
1
)
)
/*if the line is "FD"*/
{
}
else
if
(
!
strncasecmp
(
psz_parse
,
"FD"
,
strlen
(
"FD"
)
)
)
{}
else
if
(
!
strncasecmp
(
psz_parse
,
"BR!"
,
s
izeof
(
"BR!"
)
-
1
)
)
/*if the line is "BR!"*/
else
if
(
!
strncasecmp
(
psz_parse
,
"BR!"
,
s
trlen
(
"BR!"
)
)
)
{
input_item_AddSubItem
(
p_current_input
,
p_input
);
p_input
=
NULL
;
}
if
(
psz_tabvalue
)
free
(
psz_tabvalue
);
psz_tabvalue
=
NULL
;
free
(
psz_line
);
psz_line
=
NULL
;
/* Fetch another line */
FREENULL
(
psz_tabvalue
);
free
(
psz_line
);
psz_line
=
stream_ReadLine
(
p_demux
->
s
);
i_parsed_duration
=
0
;
...
...
@@ -343,16 +306,13 @@ static char* ParseTabValue(char* psz_string)
int
i_len
=
strlen
(
psz_string
);
if
(
i_len
<=
3
)
return
NULL
;
char
*
psz_value
=
(
char
*
)
malloc
(
i_len
);
char
*
psz_value
=
calloc
(
i_len
,
1
);
if
(
!
psz_value
)
return
NULL
;
memset
(
psz_value
,
0
,
i_len
);
sscanf
(
psz_string
,
"%*[^=]=%[^
\0\r\t\n
]"
,
psz_value
);
if
(
strlen
(
psz_value
)
)
sscanf
(
psz_string
,
"%*[^=]=%[^
\r\t\n
]"
,
psz_value
);
return
psz_value
;
free
(
psz_value
);
return
NULL
;
}
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