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
701cf688
Commit
701cf688
authored
Apr 12, 2008
by
Max Kellermann
Committed by
Eric Wong
Apr 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the notify API in the decoder
git-svn-id:
https://svn.musicpd.org/mpd/trunk@7281
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
0146fbe3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
decode.c
src/decode.c
+8
-6
decode.h
src/decode.h
+3
-0
playerData.c
src/playerData.c
+1
-0
No files found.
src/decode.c
View file @
701cf688
...
@@ -30,9 +30,6 @@
...
@@ -30,9 +30,6 @@
#include "utf8.h"
#include "utf8.h"
#include "os_compat.h"
#include "os_compat.h"
static
pthread_cond_t
decoder_wakeup_cond
=
PTHREAD_COND_INITIALIZER
;
static
pthread_mutex_t
decoder_wakeup_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
/* called inside decoder_task (inputPlugins) */
/* called inside decoder_task (inputPlugins) */
void
decoder_wakeup_player
(
void
)
void
decoder_wakeup_player
(
void
)
{
{
...
@@ -41,19 +38,22 @@ void decoder_wakeup_player(void)
...
@@ -41,19 +38,22 @@ void decoder_wakeup_player(void)
void
decoder_sleep
(
void
)
void
decoder_sleep
(
void
)
{
{
pthread_cond_wait
(
&
decoder_wakeup_cond
,
&
decoder_wakeup_mutex
);
DecoderControl
*
dc
=
&
(
getPlayerData
()
->
decoderControl
);
notifyWait
(
&
dc
->
notify
);
wakeup_player_nb
();
wakeup_player_nb
();
}
}
static
void
player_wakeup_decoder_nb
(
void
)
static
void
player_wakeup_decoder_nb
(
void
)
{
{
pthread_cond_signal
(
&
decoder_wakeup_cond
);
DecoderControl
*
dc
=
&
(
getPlayerData
()
->
decoderControl
);
notifySignal
(
&
dc
->
notify
);
}
}
/* called from player_task */
/* called from player_task */
static
void
player_wakeup_decoder
(
void
)
static
void
player_wakeup_decoder
(
void
)
{
{
pthread_cond_signal
(
&
decoder_wakeup_cond
);
DecoderControl
*
dc
=
&
(
getPlayerData
()
->
decoderControl
);
notifySignal
(
&
dc
->
notify
);
player_sleep
();
player_sleep
();
}
}
...
@@ -332,6 +332,8 @@ static void * decoder_task(mpd_unused void *unused)
...
@@ -332,6 +332,8 @@ static void * decoder_task(mpd_unused void *unused)
PlayerControl
*
pc
=
&
(
getPlayerData
()
->
playerControl
);
PlayerControl
*
pc
=
&
(
getPlayerData
()
->
playerControl
);
DecoderControl
*
dc
=
&
(
getPlayerData
()
->
decoderControl
);
DecoderControl
*
dc
=
&
(
getPlayerData
()
->
decoderControl
);
notifyEnter
(
&
dc
->
notify
);
while
(
1
)
{
while
(
1
)
{
if
(
dc
->
start
||
dc
->
seek
)
{
if
(
dc
->
start
||
dc
->
seek
)
{
decodeStart
(
pc
,
cb
,
dc
);
decodeStart
(
pc
,
cb
,
dc
);
...
...
src/decode.h
View file @
701cf688
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "mpd_types.h"
#include "mpd_types.h"
#include "audio.h"
#include "audio.h"
#include "notify.h"
#include "os_compat.h"
#include "os_compat.h"
...
@@ -41,6 +42,8 @@
...
@@ -41,6 +42,8 @@
#define DECODE_ERROR_FILE 20
#define DECODE_ERROR_FILE 20
typedef
struct
_DecoderControl
{
typedef
struct
_DecoderControl
{
Notify
notify
;
volatile
mpd_sint8
state
;
volatile
mpd_sint8
state
;
volatile
mpd_sint8
stop
;
volatile
mpd_sint8
stop
;
volatile
mpd_sint8
start
;
volatile
mpd_sint8
start
;
...
...
src/playerData.c
View file @
701cf688
...
@@ -113,6 +113,7 @@ void initPlayerData(void)
...
@@ -113,6 +113,7 @@ void initPlayerData(void)
playerData_pd
->
playerControl
.
softwareVolume
=
1000
;
playerData_pd
->
playerControl
.
softwareVolume
=
1000
;
playerData_pd
->
playerControl
.
totalPlayTime
=
0
;
playerData_pd
->
playerControl
.
totalPlayTime
=
0
;
notifyInit
(
&
playerData_pd
->
decoderControl
.
notify
);
playerData_pd
->
decoderControl
.
stop
=
0
;
playerData_pd
->
decoderControl
.
stop
=
0
;
playerData_pd
->
decoderControl
.
start
=
0
;
playerData_pd
->
decoderControl
.
start
=
0
;
playerData_pd
->
decoderControl
.
state
=
DECODE_STATE_STOP
;
playerData_pd
->
decoderControl
.
state
=
DECODE_STATE_STOP
;
...
...
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