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
1465bfab
Commit
1465bfab
authored
Apr 12, 2008
by
Max Kellermann
Committed by
Eric Wong
Apr 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass pc to player_task()
Another global variable cleanup patch. git-svn-id:
https://svn.musicpd.org/mpd/trunk@7321
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
8098d8ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
main.c
src/main.c
+1
-1
player.c
src/player.c
+4
-4
player.h
src/player.h
+1
-1
No files found.
src/main.c
View file @
1465bfab
...
...
@@ -444,7 +444,7 @@ int main(int argc, char *argv[])
openVolumeDevice
();
decoderInit
();
playerInit
();
playerInit
(
&
getPlayerData
()
->
playerControl
);
read_state_file
();
notifyEnter
(
&
main_notify
);
...
...
src/player.c
View file @
1465bfab
...
...
@@ -51,9 +51,9 @@ void player_sleep(PlayerControl *pc)
notifyWait
(
&
pc
->
notify
);
}
static
void
*
player_task
(
mpd_unused
void
*
unused
)
static
void
*
player_task
(
void
*
arg
)
{
PlayerControl
*
pc
=
&
(
getPlayerData
()
->
playerControl
)
;
PlayerControl
*
pc
=
arg
;
notifyEnter
(
&
pc
->
notify
);
...
...
@@ -86,14 +86,14 @@ static void * player_task(mpd_unused void *unused)
return
NULL
;
}
void
playerInit
(
void
)
void
playerInit
(
PlayerControl
*
pc
)
{
pthread_attr_t
attr
;
pthread_t
player_thread
;
pthread_attr_init
(
&
attr
);
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_DETACHED
);
if
(
pthread_create
(
&
player_thread
,
&
attr
,
player_task
,
NULL
))
if
(
pthread_create
(
&
player_thread
,
&
attr
,
player_task
,
pc
))
FATAL
(
"Failed to spawn player task: %s
\n
"
,
strerror
(
errno
));
}
...
...
src/player.h
View file @
1465bfab
...
...
@@ -138,6 +138,6 @@ int getPlayerChannels(void);
Song
*
playerCurrentDecodeSong
(
void
);
void
playerInit
(
void
);
void
playerInit
(
PlayerControl
*
pc
);
#endif
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