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
4a253e8c
Commit
4a253e8c
authored
Nov 06, 2004
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new API for M3U demuxer
parent
6992f554
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
14 deletions
+32
-14
modules/demux/playlist/m3u.c
modules/demux/playlist/m3u.c
+30
-12
modules/demux/playlist/pls.c
modules/demux/playlist/pls.c
+2
-2
No files found.
modules/demux/playlist/m3u.c
View file @
4a253e8c
...
...
@@ -5,7 +5,7 @@
* $Id$
*
* Authors: Clment Stenac <zorglub@videolan.org>
*
Authors:
Sigmund Augdal <sigmunau@idi.ntnu.no>
*
Sigmund Augdal <sigmunau@idi.ntnu.no>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -106,12 +106,13 @@ static int Demux( demux_t *p_demux )
{
playlist_t
*
p_playlist
;
char
*
psz_line
;
int
i_position
;
char
*
psz_name
=
NULL
;
mtime_t
i_duration
=
-
1
;
char
**
ppsz_options
=
NULL
;
int
i_options
=
0
;
int
i_options
=
0
,
i
;
playlist_item_t
*
p_item
;
vlc_bool_t
b_cleanup
=
VLC_FALSE
;
...
...
@@ -123,10 +124,8 @@ static int Demux( demux_t *p_demux )
return
-
1
;
}
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
p_playlist
->
pp_items
[
p_playlist
->
i_index
]
->
b_autodeletion
=
VLC_TRUE
;
i_position
=
p_playlist
->
i_index
+
1
;
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
playlist_ItemToNode
(
p_playlist
,
p_playlist
->
status
.
p_item
);
p_playlist
->
status
.
p_item
->
input
.
i_type
=
ITEM_TYPE_PLAYLIST
;
psz_line
=
stream_ReadLine
(
p_demux
->
s
);
while
(
psz_line
)
...
...
@@ -142,7 +141,7 @@ static int Demux( demux_t *p_demux )
/* Parse extra info */
/* Skip leading tabs and spaces */
while
(
*
psz_parse
==
' '
||
*
psz_parse
==
'\t'
||
while
(
*
psz_parse
==
' '
||
*
psz_parse
==
'\t'
||
*
psz_parse
==
'\n'
||
*
psz_parse
==
'\r'
||
*
psz_parse
==
'#'
)
psz_parse
++
;
...
...
@@ -189,11 +188,26 @@ static int Demux( demux_t *p_demux )
b_cleanup
=
VLC_TRUE
;
if
(
!
psz_mrl
)
goto
error
;
playlist_AddExt
(
p_playlist
,
psz_mrl
,
psz_name
,
PLAYLIST_INSERT
,
i_position
,
i_duration
,
(
const
char
**
)
ppsz_options
,
i_options
);
p_item
=
playlist_ItemNew
(
p_playlist
,
psz_mrl
,
psz_name
);
for
(
i
=
0
;
i
<
i_options
;
i
++
)
{
playlist_ItemAddOption
(
p_item
,
ppsz_options
[
i
]
);
}
p_item
->
input
.
i_duration
=
i_duration
;
playlist_NodeAddItem
(
p_playlist
,
p_item
,
p_playlist
->
status
.
p_item
->
pp_parents
[
0
]
->
i_view
,
p_playlist
->
status
.
p_item
,
PLAYLIST_APPEND
,
PLAYLIST_END
);
i_position
++
;
/* We need to declare the parents of the node as the
* * same of the parent's ones */
for
(
i
=
1
;
i
<
p_playlist
->
status
.
p_item
->
i_parents
;
i
++
)
{
playlist_ItemAddParent
(
p_item
,
p_playlist
->
status
.
p_item
->
pp_parents
[
i
]
->
i_view
,
p_playlist
->
status
.
p_item
);
}
free
(
psz_mrl
);
}
...
...
@@ -218,6 +232,10 @@ static int Demux( demux_t *p_demux )
}
}
/* Go back and play the playlist */
playlist_Control
(
p_playlist
,
PLAYLIST_VIEWPLAY
,
p_playlist
->
status
.
i_view
,
p_playlist
->
status
.
p_item
,
NULL
);
vlc_object_release
(
p_playlist
);
return
VLC_SUCCESS
;
}
...
...
modules/demux/playlist/pls.c
View file @
4a253e8c
...
...
@@ -188,7 +188,7 @@ static int Demux( demux_t *p_demux )
PLAYLIST_INSERT
,
i_position
);
if
(
i_duration
!=
-
1
)
{
playlist_SetDuration
(
p_playlist
,
i_position
,
i_duration
);
//
playlist_SetDuration( p_playlist, i_position, i_duration );
}
i_position
++
;
free
(
psz_mrl
);
...
...
@@ -236,7 +236,7 @@ static int Demux( demux_t *p_demux )
PLAYLIST_INSERT
,
i_position
);
if
(
i_duration
!=
-
1
)
{
playlist_SetDuration
(
p_playlist
,
i_position
,
i_duration
);
//
playlist_SetDuration( p_playlist, i_position, i_duration );
}
i_position
++
;
free
(
psz_mrl
);
...
...
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