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
ac0e7999
Commit
ac0e7999
authored
Jan 25, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_control: added decoder_control.thread
decoder_control.thread contains the handle of the decoder thread, or NULL if the decoder thread isn't running.
parent
2c45224b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
decoder_control.c
src/decoder_control.c
+7
-2
decoder_control.h
src/decoder_control.h
+5
-1
decoder_thread.c
src/decoder_thread.c
+4
-2
player_thread.c
src/player_thread.c
+1
-1
No files found.
src/decoder_control.c
View file @
ac0e7999
...
...
@@ -102,8 +102,13 @@ dc_seek(struct notify *notify, double where)
}
void
dc_quit
(
struct
notify
*
notify
)
dc_quit
(
void
)
{
assert
(
dc
.
thread
!=
NULL
);
dc
.
quit
=
true
;
dc_command
(
notify
,
DECODE_COMMAND_STOP
);
dc_command_async
(
DECODE_COMMAND_STOP
);
g_thread_join
(
dc
.
thread
);
dc
.
thread
=
NULL
;
}
src/decoder_control.h
View file @
ac0e7999
...
...
@@ -45,6 +45,10 @@ enum decoder_state {
};
struct
decoder_control
{
/** the handle of the decoder thread, or NULL if the decoder
thread isn't running */
GThread
*
thread
;
struct
notify
notify
;
volatile
enum
decoder_state
state
;
...
...
@@ -124,6 +128,6 @@ bool
dc_seek
(
struct
notify
*
notify
,
double
where
);
void
dc_quit
(
struct
notify
*
notify
);
dc_quit
(
void
);
#endif
src/decoder_thread.c
View file @
ac0e7999
...
...
@@ -258,8 +258,10 @@ static gpointer decoder_task(G_GNUC_UNUSED gpointer arg)
void
decoder_thread_start
(
void
)
{
GError
*
e
=
NULL
;
GThread
*
t
;
if
(
!
(
t
=
g_thread_create
(
decoder_task
,
NULL
,
FALSE
,
&
e
)))
assert
(
dc
.
thread
==
NULL
);
dc
.
thread
=
g_thread_create
(
decoder_task
,
NULL
,
true
,
&
e
);
if
(
dc
.
thread
==
NULL
)
FATAL
(
"Failed to spawn decoder task: %s
\n
"
,
e
->
message
);
}
src/player_thread.c
View file @
ac0e7999
...
...
@@ -526,7 +526,7 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
break
;
case
PLAYER_COMMAND_EXIT
:
dc_quit
(
&
pc
.
notify
);
dc_quit
();
closeAudioDevice
();
player_command_finished
();
g_thread_exit
(
NULL
);
...
...
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