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
e966180e
Commit
e966180e
authored
Jan 05, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a custom condition variable for the playlist engine
parent
262e789e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
11 deletions
+22
-11
src/playlist/control.c
src/playlist/control.c
+1
-1
src/playlist/engine.c
src/playlist/engine.c
+3
-1
src/playlist/item.c
src/playlist/item.c
+5
-5
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+2
-0
src/playlist/search.c
src/playlist/search.c
+1
-1
src/playlist/thread.c
src/playlist/thread.c
+10
-3
No files found.
src/playlist/control.c
View file @
e966180e
...
@@ -176,7 +176,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
...
@@ -176,7 +176,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
msg_Err
(
p_playlist
,
"unknown playlist query"
);
msg_Err
(
p_playlist
,
"unknown playlist query"
);
return
VLC_EBADVAR
;
return
VLC_EBADVAR
;
}
}
vlc_
object_signal_unlocked
(
p_playlist
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
src/playlist/engine.c
View file @
e966180e
...
@@ -49,7 +49,7 @@ static int RandomCallback( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -49,7 +49,7 @@ static int RandomCallback( vlc_object_t *p_this, char const *psz_cmd,
PL_LOCK
;
PL_LOCK
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
vlc_
object_signal_unlocked
(
p_playlist
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
PL_UNLOCK
;
PL_UNLOCK
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -81,6 +81,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
...
@@ -81,6 +81,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
libvlc_priv
(
p_parent
->
p_libvlc
)
->
p_playlist
=
p_playlist
;
libvlc_priv
(
p_parent
->
p_libvlc
)
->
p_playlist
=
p_playlist
;
VariablesInit
(
p_playlist
);
VariablesInit
(
p_playlist
);
vlc_cond_init
(
&
p
->
signal
);
/* Initialise data structures */
/* Initialise data structures */
pl_priv
(
p_playlist
)
->
i_last_playlist_id
=
0
;
pl_priv
(
p_playlist
)
->
i_last_playlist_id
=
0
;
...
@@ -179,6 +180,7 @@ static void playlist_Destructor( vlc_object_t * p_this )
...
@@ -179,6 +180,7 @@ static void playlist_Destructor( vlc_object_t * p_this )
assert
(
!
p_sys
->
p_preparser
);
assert
(
!
p_sys
->
p_preparser
);
assert
(
!
p_sys
->
p_fetcher
);
assert
(
!
p_sys
->
p_fetcher
);
vlc_cond_destroy
(
&
p_sys
->
signal
);
msg_Dbg
(
p_this
,
"Destroyed"
);
msg_Dbg
(
p_this
,
"Destroyed"
);
}
}
...
...
src/playlist/item.c
View file @
e966180e
...
@@ -635,7 +635,7 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
...
@@ -635,7 +635,7 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
p_playlist
->
p_root_onelevel
,
false
);
p_playlist
->
p_root_onelevel
,
false
);
}
}
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
vlc_
object_signal_unlocked
(
p_playlist
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
var_SetInteger
(
p_playlist
,
"item-change"
,
p_item_in_category
->
var_SetInteger
(
p_playlist
,
"item-change"
,
p_item_in_category
->
p_input
->
i_id
);
p_input
->
i_id
);
PL_UNLOCK_IF
(
!
b_locked
);
PL_UNLOCK_IF
(
!
b_locked
);
...
@@ -772,7 +772,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
...
@@ -772,7 +772,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
else
else
i_ret
=
TreeMove
(
p_playlist
,
p_item
,
p_node
,
i_newpos
);
i_ret
=
TreeMove
(
p_playlist
,
p_item
,
p_node
,
i_newpos
);
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
vlc_
object_signal_unlocked
(
p_playlist
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
return
i_ret
;
return
i_ret
;
}
}
...
@@ -800,7 +800,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
...
@@ -800,7 +800,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
val
.
p_address
=
p_add
;
val
.
p_address
=
p_add
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
if
(
b_signal
)
if
(
b_signal
)
vlc_
object_signal_unlocked
(
p_playlist
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
var_Set
(
p_playlist
,
"item-append"
,
val
);
var_Set
(
p_playlist
,
"item-append"
,
val
);
free
(
p_add
);
free
(
p_add
);
...
@@ -839,7 +839,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
...
@@ -839,7 +839,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode,
if
(
pl_priv
(
p_playlist
)
->
p_input
)
if
(
pl_priv
(
p_playlist
)
->
p_input
)
input_StopThread
(
pl_priv
(
p_playlist
)
->
p_input
);
input_StopThread
(
pl_priv
(
p_playlist
)
->
p_input
);
pl_priv
(
p_playlist
)
->
request
.
i_status
=
PLAYLIST_RUNNING
;
pl_priv
(
p_playlist
)
->
request
.
i_status
=
PLAYLIST_RUNNING
;
vlc_
object_signal_unlocked
(
p_playlist
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
}
}
/* Preparse if PREPARSE or SPREPARSE & not enough meta */
/* Preparse if PREPARSE or SPREPARSE & not enough meta */
char
*
psz_artist
=
input_item_GetArtist
(
p_item_cat
->
p_input
);
char
*
psz_artist
=
input_item_GetArtist
(
p_item_cat
->
p_input
);
...
@@ -922,7 +922,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
...
@@ -922,7 +922,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
pl_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
pl_priv
(
p_playlist
)
->
request
.
b_request
=
true
;
pl_priv
(
p_playlist
)
->
request
.
p_item
=
NULL
;
pl_priv
(
p_playlist
)
->
request
.
p_item
=
NULL
;
msg_Info
(
p_playlist
,
"stopping playback"
);
msg_Info
(
p_playlist
,
"stopping playback"
);
vlc_
object_signal_unlocked
(
VLC_OBJECT
(
p_playlist
)
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
}
}
}
}
...
...
src/playlist/playlist_internal.h
View file @
e966180e
...
@@ -82,6 +82,8 @@ typedef struct playlist_private_t
...
@@ -82,6 +82,8 @@ typedef struct playlist_private_t
vlc_mutex_t
lock
;
/**< Lock to protect request */
vlc_mutex_t
lock
;
/**< Lock to protect request */
}
request
;
}
request
;
vlc_cond_t
signal
;
/**< wakes up the playlist engine thread */
int
i_last_playlist_id
;
/**< Last id to an item */
int
i_last_playlist_id
;
/**< Last id to an item */
bool
b_reset_currently_playing
;
/** Reset current item array */
bool
b_reset_currently_playing
;
/** Reset current item array */
...
...
src/playlist/search.c
View file @
e966180e
...
@@ -173,6 +173,6 @@ int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root,
...
@@ -173,6 +173,6 @@ int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root,
PL_ASSERT_LOCKED
;
PL_ASSERT_LOCKED
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
playlist_LiveSearchUpdateInternal
(
p_playlist
,
p_root
,
psz_string
);
playlist_LiveSearchUpdateInternal
(
p_playlist
,
p_root
,
psz_string
);
vlc_
object_signal_unlocked
(
p_playlist
);
vlc_
cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
src/playlist/thread.c
View file @
e966180e
...
@@ -82,6 +82,10 @@ void playlist_Deactivate( playlist_t *p_playlist )
...
@@ -82,6 +82,10 @@ void playlist_Deactivate( playlist_t *p_playlist )
msg_Dbg
(
p_playlist
,
"Deactivate"
);
msg_Dbg
(
p_playlist
,
"Deactivate"
);
vlc_object_kill
(
p_playlist
);
vlc_object_kill
(
p_playlist
);
PL_LOCK
;
vlc_cond_signal
(
&
p_sys
->
signal
);
PL_UNLOCK
;
vlc_thread_join
(
p_playlist
);
vlc_thread_join
(
p_playlist
);
assert
(
!
p_sys
->
p_input
);
assert
(
!
p_sys
->
p_input
);
...
@@ -150,7 +154,8 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -150,7 +154,8 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd,
PL_LOCK
;
PL_LOCK
;
vlc_object_signal_unlocked
(
p_playlist
);
/* XXX: signaling while not changing any parameter... suspicious... */
vlc_cond_signal
(
&
pl_priv
(
p_playlist
)
->
signal
);
PL_UNLOCK
;
PL_UNLOCK
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -548,7 +553,8 @@ static void LoopRequest( playlist_t *p_playlist )
...
@@ -548,7 +553,8 @@ static void LoopRequest( playlist_t *p_playlist )
input_ressource_TerminateVout
(
p_sys
->
p_input_ressource
);
input_ressource_TerminateVout
(
p_sys
->
p_input_ressource
);
if
(
vlc_object_alive
(
p_playlist
)
)
if
(
vlc_object_alive
(
p_playlist
)
)
vlc_object_wait
(
p_playlist
);
vlc_cond_wait
(
&
pl_priv
(
p_playlist
)
->
signal
,
&
vlc_internals
(
p_playlist
)
->
lock
);
return
;
return
;
}
}
...
@@ -593,7 +599,8 @@ static void *Thread ( vlc_object_t *p_this )
...
@@ -593,7 +599,8 @@ static void *Thread ( vlc_object_t *p_this )
/* If there is an input, check that it doesn't need to die. */
/* If there is an input, check that it doesn't need to die. */
while
(
!
LoopInput
(
p_playlist
)
)
while
(
!
LoopInput
(
p_playlist
)
)
vlc_object_wait
(
p_playlist
);
vlc_cond_wait
(
&
pl_priv
(
p_playlist
)
->
signal
,
&
vlc_internals
(
p_playlist
)
->
lock
);
LoopRequest
(
p_playlist
);
LoopRequest
(
p_playlist
);
}
}
...
...
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