Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
1b24f8ca
Commit
1b24f8ca
authored
Sep 15, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* playlist.c: coding and potential deadlock fixes.
parent
9bf18d7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
29 deletions
+27
-29
src/playlist/playlist.c
src/playlist/playlist.c
+27
-29
No files found.
src/playlist/playlist.c
View file @
1b24f8ca
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
* playlist.c : Playlist management functions
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.5
1 2003/09/13 17:42:16
fenrir Exp $
* $Id: playlist.c,v 1.5
2 2003/09/15 00:01:49
fenrir Exp $
*
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Authors: Samuel Hocevar <sam@zoy.org>
*
*
...
@@ -371,43 +371,43 @@ int playlist_Delete( playlist_t * p_playlist, int i_pos )
...
@@ -371,43 +371,43 @@ int playlist_Delete( playlist_t * p_playlist, int i_pos )
*/
*/
int
playlist_Sort
(
playlist_t
*
p_playlist
,
int
i_type
)
int
playlist_Sort
(
playlist_t
*
p_playlist
,
int
i_type
)
{
{
int
i
,
i_small
,
i_position
;
int
i
,
i_small
,
i_position
;
playlist_item_t
*
p_temp
;
playlist_item_t
*
p_temp
;
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
for
(
i_position
=
0
;
i_position
<
p_playlist
->
i_size
-
1
;
i_position
++
)
for
(
i_position
=
0
;
i_position
<
p_playlist
->
i_size
-
1
;
i_position
++
)
{
{
i_small
=
i_position
;
i_small
=
i_position
;
for
(
i
=
i_position
+
1
;
i
<
p_playlist
->
i_size
;
i
++
)
for
(
i
=
i_position
+
1
;
i
<
p_playlist
->
i_size
;
i
++
)
{
{
int
i_test
;
if
(
(
strcasecmp
(
p_playlist
->
pp_items
[
i
]
->
psz_name
,
p_playlist
->
pp_items
[
i_small
]
->
psz_name
)
<
0
i_test
=
strcasecmp
(
p_playlist
->
pp_items
[
i
]
->
psz_name
,
&&
i_type
==
SORT_NORMAL
)
||
p_playlist
->
pp_items
[
i_small
]
->
psz_name
);
(
strcasecmp
(
p_playlist
->
pp_items
[
i
]
->
psz_name
,
p_playlist
->
pp_items
[
i_small
]
->
psz_name
)
>
0
if
(
i_type
==
SORT_NORMAL
&&
i_test
<
0
||
&&
i_type
==
SORT_REVERSE
)
)
i_type
==
SORT_REVERSE
&&
i_test
>
0
)
i_small
=
i
;
{
i_small
=
i
;
p_temp
=
p_playlist
->
pp_items
[
i_position
];
}
p_playlist
->
pp_items
[
i_position
]
=
p_playlist
->
pp_items
[
i_small
];
p_playlist
->
pp_items
[
i_small
]
=
p_temp
;
p_temp
=
p_playlist
->
pp_items
[
i_position
];
p_playlist
->
pp_items
[
i_position
]
=
p_playlist
->
pp_items
[
i_small
];
}
p_playlist
->
pp_items
[
i_small
]
=
p_temp
;
}
}
}
for
(
i
=
0
;
i
<
p_playlist
->
i_size
;
i
++
)
msg_Dbg
(
p_playlist
,
"%s"
,
p_playlist
->
pp_items
[
i
]
->
psz_name
);
for
(
i
=
0
;
i
<
p_playlist
->
i_size
;
i
++
)
{
msg_Dbg
(
p_playlist
,
"%s"
,
p_playlist
->
pp_items
[
i
]
->
psz_name
);
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
return
0
;
return
0
;
}
}
/**
/**
* Move an item in a playlist
* Move an item in a playlist
*
*
...
@@ -671,10 +671,8 @@ static void RunThread ( playlist_t *p_playlist )
...
@@ -671,10 +671,8 @@ static void RunThread ( playlist_t *p_playlist )
/* Select the next playlist item */
/* Select the next playlist item */
SkipItem
(
p_playlist
,
1
);
SkipItem
(
p_playlist
,
1
);
/* Release the playlist lock, because we may get stuck
* in input_StopThread() for some time. */
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
input_StopThread
(
p_playlist
->
p_input
);
input_StopThread
(
p_playlist
->
p_input
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
continue
;
continue
;
}
}
else
if
(
p_playlist
->
p_input
->
stream
.
control
.
i_status
!=
INIT_S
)
else
if
(
p_playlist
->
p_input
->
stream
.
control
.
i_status
!=
INIT_S
)
...
@@ -739,8 +737,8 @@ static void RunThread ( playlist_t *p_playlist )
...
@@ -739,8 +737,8 @@ static void RunThread ( playlist_t *p_playlist )
}
}
else
if
(
p_playlist
->
p_input
->
b_error
||
p_playlist
->
p_input
->
b_eof
)
else
if
(
p_playlist
->
p_input
->
b_error
||
p_playlist
->
p_input
->
b_eof
)
{
{
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
input_StopThread
(
p_playlist
->
p_input
);
input_StopThread
(
p_playlist
->
p_input
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
continue
;
continue
;
}
}
else
else
...
...
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