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
b1598324
Commit
b1598324
authored
Oct 08, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notify: removed the "Notify" typedef
Typedefs shouldn't be used, use the bare struct names instead.
parent
d562ba5f
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
19 deletions
+29
-19
decoder_control.c
src/decoder_control.c
+9
-5
decoder_control.h
src/decoder_control.h
+8
-5
main_notify.c
src/main_notify.c
+1
-1
notify.h
src/notify.h
+2
-2
outputBuffer.c
src/outputBuffer.c
+3
-2
outputBuffer.h
src/outputBuffer.h
+5
-3
player_control.h
src/player_control.h
+1
-1
No files found.
src/decoder_control.c
View file @
b1598324
...
...
@@ -33,7 +33,8 @@ void dc_deinit(void)
notify_deinit
(
&
dc
.
notify
);
}
void
dc_command_wait
(
Notify
*
notify
)
void
dc_command_wait
(
struct
notify
*
notify
)
{
while
(
dc
.
command
!=
DECODE_COMMAND_NONE
)
{
notify_signal
(
&
dc
.
notify
);
...
...
@@ -41,7 +42,8 @@ void dc_command_wait(Notify *notify)
}
}
static
void
dc_command
(
Notify
*
notify
,
enum
decoder_command
cmd
)
static
void
dc_command
(
struct
notify
*
notify
,
enum
decoder_command
cmd
)
{
dc
.
command
=
cmd
;
dc_command_wait
(
notify
);
...
...
@@ -54,7 +56,7 @@ static void dc_command_async(enum decoder_command cmd)
}
void
dc_start
(
N
otify
*
notify
,
struct
song
*
song
)
dc_start
(
struct
n
otify
*
notify
,
struct
song
*
song
)
{
assert
(
song
!=
NULL
);
...
...
@@ -73,14 +75,16 @@ dc_start_async(struct song *song)
dc_command_async
(
DECODE_COMMAND_START
);
}
void
dc_stop
(
Notify
*
notify
)
void
dc_stop
(
struct
notify
*
notify
)
{
if
(
dc
.
command
==
DECODE_COMMAND_START
||
dc
.
state
!=
DECODE_STATE_STOP
)
dc_command
(
notify
,
DECODE_COMMAND_STOP
);
}
int
dc_seek
(
Notify
*
notify
,
double
where
)
int
dc_seek
(
struct
notify
*
notify
,
double
where
)
{
assert
(
where
>=
0
.
0
);
...
...
src/decoder_control.h
View file @
b1598324
...
...
@@ -39,7 +39,7 @@ enum decoder_state {
#define DECODE_ERROR_FILE 20
struct
decoder_control
{
N
otify
notify
;
struct
n
otify
notify
;
volatile
enum
decoder_state
state
;
volatile
enum
decoder_command
command
;
...
...
@@ -81,16 +81,19 @@ decoder_current_song(void)
return
dc
.
current_song
;
}
void
dc_command_wait
(
Notify
*
notify
);
void
dc_command_wait
(
struct
notify
*
notify
);
void
dc_start
(
N
otify
*
notify
,
struct
song
*
song
);
dc_start
(
struct
n
otify
*
notify
,
struct
song
*
song
);
void
dc_start_async
(
struct
song
*
song
);
void
dc_stop
(
Notify
*
notify
);
void
dc_stop
(
struct
notify
*
notify
);
int
dc_seek
(
Notify
*
notify
,
double
where
);
int
dc_seek
(
struct
notify
*
notify
,
double
where
);
#endif
src/main_notify.c
View file @
b1598324
...
...
@@ -28,7 +28,7 @@
static
struct
ioOps
main_notify_IO
;
static
int
main_pipe
[
2
];
pthread_t
main_task
;
static
N
otify
main_notify
;
static
struct
n
otify
main_notify
;
static
pthread_mutex_t
select_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
int
ioops_fdset
(
fd_set
*
rfds
,
...
...
src/notify.h
View file @
b1598324
...
...
@@ -21,11 +21,11 @@
#include "os_compat.h"
typedef
struct
notify
{
struct
notify
{
pthread_mutex_t
mutex
;
pthread_cond_t
cond
;
int
pending
;
}
Notify
;
};
#define NOTIFY_INITIALIZER { \
.mutex = PTHREAD_MUTEX_INITIALIZER, \
...
...
src/outputBuffer.c
View file @
b1598324
...
...
@@ -17,12 +17,13 @@
*/
#include "outputBuffer.h"
#include "notify.h"
#include "utils.h"
struct
output_buffer
ob
;
void
ob_init
(
unsigned
int
size
,
Notify
*
notify
)
void
ob_init
(
unsigned
int
size
,
struct
notify
*
notify
)
{
assert
(
size
>
0
);
...
...
src/outputBuffer.h
View file @
b1598324
...
...
@@ -19,9 +19,10 @@
#ifndef OUTPUT_BUFFER_H
#define OUTPUT_BUFFER_H
#include "notify.h"
#include "audio_format.h"
#include <stddef.h>
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
#define CHUNK_SIZE 1020
...
...
@@ -53,12 +54,13 @@ struct output_buffer {
struct
audio_format
audioFormat
;
N
otify
*
notify
;
struct
n
otify
*
notify
;
};
extern
struct
output_buffer
ob
;
void
ob_init
(
unsigned
int
size
,
Notify
*
notify
);
void
ob_init
(
unsigned
int
size
,
struct
notify
*
notify
);
void
ob_free
(
void
);
...
...
src/player_control.h
View file @
b1598324
...
...
@@ -80,7 +80,7 @@ enum player_queue_state {
struct
player_control
{
unsigned
int
buffered_before_play
;
N
otify
notify
;
struct
n
otify
notify
;
volatile
enum
player_command
command
;
volatile
enum
player_state
state
;
volatile
int8_t
error
;
...
...
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