Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d628eb3e
Commit
d628eb3e
authored
Jan 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player_control: added player_control.thread
player_control.thread contains the handle of the player thread, or NULL if the player thread isn't running.
parent
ac0e7999
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
player_control.c
src/player_control.c
+4
-0
player_control.h
src/player_control.h
+4
-0
player_thread.c
src/player_thread.c
+4
-2
No files found.
src/player_control.c
View file @
d628eb3e
...
...
@@ -90,7 +90,11 @@ void playerWait(void)
void
playerKill
(
void
)
{
assert
(
pc
.
thread
!=
NULL
);
player_command
(
PLAYER_COMMAND_EXIT
);
g_thread_join
(
pc
.
thread
);
pc
.
thread
=
NULL
;
idle_add
(
IDLE_PLAYER
);
}
...
...
src/player_control.h
View file @
d628eb3e
...
...
@@ -62,6 +62,10 @@ enum player_error {
struct
player_control
{
unsigned
int
buffered_before_play
;
/** the handle of the player thread, or NULL if the player
thread isn't running */
GThread
*
thread
;
struct
notify
notify
;
volatile
enum
player_command
command
;
volatile
enum
player_state
state
;
...
...
src/player_thread.c
View file @
d628eb3e
...
...
@@ -548,8 +548,10 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
void
player_create
(
void
)
{
GError
*
e
=
NULL
;
GThread
*
t
;
if
(
!
(
t
=
g_thread_create
(
player_task
,
NULL
,
FALSE
,
&
e
)))
assert
(
pc
.
thread
==
NULL
);
pc
.
thread
=
g_thread_create
(
player_task
,
NULL
,
true
,
&
e
);
if
(
pc
.
thread
==
NULL
)
g_error
(
"Failed to spawn player task: %s"
,
e
->
message
);
}
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