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
97698bd4
Commit
97698bd4
authored
Jun 01, 2008
by
Max Kellerman
Committed by
Eric Wong
Jun 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notify: don't use camelCase in notify.[ch]
git-svn-id:
https://svn.musicpd.org/mpd/trunk@7367
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
e0be3aad
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
26 deletions
+26
-26
decode.c
src/decode.c
+4
-4
notify.c
src/notify.c
+7
-7
notify.h
src/notify.h
+9
-9
player.c
src/player.c
+4
-4
playerData.c
src/playerData.c
+2
-2
No files found.
src/decode.c
View file @
97698bd4
...
@@ -40,19 +40,19 @@ void decoder_wakeup_player(void)
...
@@ -40,19 +40,19 @@ void decoder_wakeup_player(void)
void
decoder_sleep
(
void
)
void
decoder_sleep
(
void
)
{
{
notify
W
ait
(
&
dc
.
notify
);
notify
_w
ait
(
&
dc
.
notify
);
wakeup_player_nb
();
wakeup_player_nb
();
}
}
static
void
player_wakeup_decoder_nb
(
void
)
static
void
player_wakeup_decoder_nb
(
void
)
{
{
notify
S
ignal
(
&
dc
.
notify
);
notify
_s
ignal
(
&
dc
.
notify
);
}
}
/* called from player_task */
/* called from player_task */
static
void
player_wakeup_decoder
(
void
)
static
void
player_wakeup_decoder
(
void
)
{
{
notify
S
ignal
(
&
dc
.
notify
);
notify
_s
ignal
(
&
dc
.
notify
);
player_sleep
();
player_sleep
();
}
}
...
@@ -322,7 +322,7 @@ stop_no_close:
...
@@ -322,7 +322,7 @@ stop_no_close:
static
void
*
decoder_task
(
mpd_unused
void
*
arg
)
static
void
*
decoder_task
(
mpd_unused
void
*
arg
)
{
{
notify
E
nter
(
&
dc
.
notify
);
notify
_e
nter
(
&
dc
.
notify
);
while
(
1
)
{
while
(
1
)
{
assert
(
dc
.
state
==
DECODE_STATE_STOP
);
assert
(
dc
.
state
==
DECODE_STATE_STOP
);
...
...
src/notify.c
View file @
97698bd4
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "notify.h"
#include "notify.h"
int
notify
I
nit
(
Notify
*
notify
)
int
notify
_i
nit
(
Notify
*
notify
)
{
{
int
ret
;
int
ret
;
...
@@ -37,32 +37,32 @@ int notifyInit(Notify *notify)
...
@@ -37,32 +37,32 @@ int notifyInit(Notify *notify)
return
0
;
return
0
;
}
}
void
notify
E
nter
(
Notify
*
notify
)
void
notify
_e
nter
(
Notify
*
notify
)
{
{
pthread_mutex_lock
(
&
notify
->
mutex
);
pthread_mutex_lock
(
&
notify
->
mutex
);
}
}
void
notify
L
eave
(
Notify
*
notify
)
void
notify
_l
eave
(
Notify
*
notify
)
{
{
pthread_mutex_unlock
(
&
notify
->
mutex
);
pthread_mutex_unlock
(
&
notify
->
mutex
);
}
}
void
notify
W
ait
(
Notify
*
notify
)
void
notify
_w
ait
(
Notify
*
notify
)
{
{
if
(
!
notify
->
pending
)
if
(
!
notify
->
pending
)
pthread_cond_wait
(
&
notify
->
cond
,
&
notify
->
mutex
);
pthread_cond_wait
(
&
notify
->
cond
,
&
notify
->
mutex
);
notify
->
pending
=
0
;
notify
->
pending
=
0
;
}
}
void
notify
S
ignal
(
Notify
*
notify
)
void
notify
_s
ignal
(
Notify
*
notify
)
{
{
notify
->
pending
=
1
;
notify
->
pending
=
1
;
pthread_cond_signal
(
&
notify
->
cond
);
pthread_cond_signal
(
&
notify
->
cond
);
}
}
void
notify
SignalS
ync
(
Notify
*
notify
)
void
notify
_signal_s
ync
(
Notify
*
notify
)
{
{
pthread_mutex_lock
(
&
notify
->
mutex
);
pthread_mutex_lock
(
&
notify
->
mutex
);
notify
S
ignal
(
notify
);
notify
_s
ignal
(
notify
);
pthread_mutex_unlock
(
&
notify
->
mutex
);
pthread_mutex_unlock
(
&
notify
->
mutex
);
}
}
src/notify.h
View file @
97698bd4
...
@@ -27,34 +27,34 @@ typedef struct _Notify {
...
@@ -27,34 +27,34 @@ typedef struct _Notify {
int
pending
;
int
pending
;
}
Notify
;
}
Notify
;
int
notify
I
nit
(
Notify
*
notify
);
int
notify
_i
nit
(
Notify
*
notify
);
/**
/**
* The thread which shall be notified by this object must call this
* The thread which shall be notified by this object must call this
* function before any notify
W
ait() invocation. It locks the mutex.
* function before any notify
_w
ait() invocation. It locks the mutex.
*/
*/
void
notify
E
nter
(
Notify
*
notify
);
void
notify
_e
nter
(
Notify
*
notify
);
/**
/**
* Neutralize notify
L
eave().
* Neutralize notify
_l
eave().
*/
*/
void
notify
L
eave
(
Notify
*
notify
);
void
notify
_l
eave
(
Notify
*
notify
);
/**
/**
* Wait for a notification. Return immediately if we have already
* Wait for a notification. Return immediately if we have already
* been notified since we last returned from notify
W
ait().
* been notified since we last returned from notify
_w
ait().
*/
*/
void
notify
W
ait
(
Notify
*
notify
);
void
notify
_w
ait
(
Notify
*
notify
);
/**
/**
* Notify the thread. This function never blocks.
* Notify the thread. This function never blocks.
*/
*/
void
notify
S
ignal
(
Notify
*
notify
);
void
notify
_s
ignal
(
Notify
*
notify
);
/**
/**
* Notify the thread synchonously, i.e. wait until it has received the
* Notify the thread synchonously, i.e. wait until it has received the
* notification.
* notification.
*/
*/
void
notify
SignalS
ync
(
Notify
*
notify
);
void
notify
_signal_s
ync
(
Notify
*
notify
);
#endif
#endif
src/player.c
View file @
97698bd4
...
@@ -38,23 +38,23 @@ static void playerCloseAudio(void);
...
@@ -38,23 +38,23 @@ static void playerCloseAudio(void);
void
wakeup_player_nb
(
void
)
void
wakeup_player_nb
(
void
)
{
{
notify
S
ignal
(
&
pc
.
notify
);
notify
_s
ignal
(
&
pc
.
notify
);
}
}
static
void
wakeup_player
(
void
)
static
void
wakeup_player
(
void
)
{
{
notify
S
ignal
(
&
pc
.
notify
);
notify
_s
ignal
(
&
pc
.
notify
);
wait_main_task
();
wait_main_task
();
}
}
void
player_sleep
(
void
)
void
player_sleep
(
void
)
{
{
notify
W
ait
(
&
pc
.
notify
);
notify
_w
ait
(
&
pc
.
notify
);
}
}
static
void
*
player_task
(
mpd_unused
void
*
arg
)
static
void
*
player_task
(
mpd_unused
void
*
arg
)
{
{
notify
E
nter
(
&
pc
.
notify
);
notify
_e
nter
(
&
pc
.
notify
);
while
(
1
)
{
while
(
1
)
{
if
(
pc
.
play
)
{
if
(
pc
.
play
)
{
...
...
src/playerData.c
View file @
97698bd4
...
@@ -79,7 +79,7 @@ void initPlayerData(void)
...
@@ -79,7 +79,7 @@ void initPlayerData(void)
ob_init
(
buffered_chunks
);
ob_init
(
buffered_chunks
);
notify
I
nit
(
&
pc
.
notify
);
notify
_i
nit
(
&
pc
.
notify
);
pc
.
error
=
PLAYER_ERROR_NOERROR
;
pc
.
error
=
PLAYER_ERROR_NOERROR
;
pc
.
state
=
PLAYER_STATE_STOP
;
pc
.
state
=
PLAYER_STATE_STOP
;
pc
.
queueState
=
PLAYER_QUEUE_BLANK
;
pc
.
queueState
=
PLAYER_QUEUE_BLANK
;
...
@@ -87,7 +87,7 @@ void initPlayerData(void)
...
@@ -87,7 +87,7 @@ void initPlayerData(void)
pc
.
crossFade
=
crossfade
;
pc
.
crossFade
=
crossfade
;
pc
.
softwareVolume
=
1000
;
pc
.
softwareVolume
=
1000
;
notify
I
nit
(
&
dc
.
notify
);
notify
_i
nit
(
&
dc
.
notify
);
dc
.
state
=
DECODE_STATE_STOP
;
dc
.
state
=
DECODE_STATE_STOP
;
dc
.
error
=
DECODE_ERROR_NOERROR
;
dc
.
error
=
DECODE_ERROR_NOERROR
;
}
}
...
...
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