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
34c546b2
Commit
34c546b2
authored
Aug 25, 2002
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./src/playlist/playlist.c: -Z flag makes playlist loop endlessly.
parent
3ece9041
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
src/playlist/playlist.c
src/playlist/playlist.c
+16
-9
No files found.
src/playlist/playlist.c
View file @
34c546b2
...
...
@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.1
1 2002/08/16 12:31:04
sam Exp $
* $Id: playlist.c,v 1.1
2 2002/08/25 19:27:20
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -426,6 +426,7 @@ static void RunThread ( playlist_t *p_playlist )
static
void
SkipItem
(
playlist_t
*
p_playlist
,
int
i_arg
)
{
int
i_oldindex
=
p_playlist
->
i_index
;
vlc_bool_t
b_random
;
/* If the playlist is empty, there is no current item */
if
(
p_playlist
->
i_size
==
0
)
...
...
@@ -434,23 +435,29 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
return
;
}
b_random
=
config_GetInt
(
p_playlist
,
"random"
);
/* Increment */
if
(
config_GetInt
(
p_playlist
,
"random"
)
)
if
(
b_random
)
{
/* Simple random stuff */
srand
(
mdate
()
);
p_playlist
->
i_index
+=
1
+
(
int
)
(
1
.
0
*
p_playlist
->
i_size
*
rand
()
/
(
RAND_MAX
+
1
.
0
)
);
}
else
{
p_playlist
->
i_index
+=
i_arg
;
/* Simple random stuff - we cheat a bit to minimize the chances to
* get the same index again. */
i_arg
=
(
int
)((
float
)
p_playlist
->
i_size
*
rand
()
/
(
RAND_MAX
+
1
.
0
));
if
(
i_arg
==
0
)
{
i_arg
=
(
int
)((
float
)
p_playlist
->
i_size
*
rand
()
/
(
RAND_MAX
+
1
.
0
));
}
}
p_playlist
->
i_index
+=
i_arg
;
/* Boundary check */
if
(
p_playlist
->
i_index
>=
p_playlist
->
i_size
)
{
if
(
p_playlist
->
i_status
==
PLAYLIST_STOPPED
||
b_random
||
config_GetInt
(
p_playlist
,
"loop"
)
)
{
p_playlist
->
i_index
-=
p_playlist
->
i_size
...
...
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