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
be753fb5
Commit
be753fb5
authored
Mar 18, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make all sleeps at least 1 ms
git-svn-id:
https://svn.musicpd.org/mpd/trunk@279
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
2320970c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
decode.c
src/decode.c
+4
-4
player.c
src/player.c
+6
-6
No files found.
src/decode.c
View file @
be753fb5
...
...
@@ -78,7 +78,7 @@ void stopDecode(DecoderControl * dc) {
(
dc
->
start
||
dc
->
state
==
DECODE_STATE_DECODE
))
{
dc
->
stop
=
1
;
while
(
decode_pid
&&
*
decode_pid
>
0
&&
dc
->
stop
)
usleep
(
10
);
while
(
decode_pid
&&
*
decode_pid
>
0
&&
dc
->
stop
)
usleep
(
10
00
);
}
}
...
...
@@ -111,7 +111,7 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) {
int
waitOnDecode
(
PlayerControl
*
pc
,
AudioFormat
*
af
,
DecoderControl
*
dc
,
Buffer
*
cb
)
{
while
(
decode_pid
&&
*
decode_pid
>
0
&&
dc
->
start
)
usleep
(
10
);
while
(
decode_pid
&&
*
decode_pid
>
0
&&
dc
->
start
)
usleep
(
10
00
);
if
(
dc
->
start
||
dc
->
error
!=
DECODE_ERROR_NOERROR
)
{
strncpy
(
pc
->
erroredFile
,
pc
->
file
,
MAXPATHLEN
);
...
...
@@ -162,7 +162,7 @@ void decodeSeek(PlayerControl * pc, AudioFormat * af, DecoderControl * dc,
dc
->
seek
=
1
;
pc
->
elapsedTime
=
dc
->
seekWhere
;
pc
->
bitRate
=
0
;
while
(
*
decode_pid
>
0
&&
dc
->
seek
)
usleep
(
10
);
while
(
*
decode_pid
>
0
&&
dc
->
seek
)
usleep
(
10
00
);
}
}
pc
->
seek
=
0
;
...
...
@@ -443,7 +443,7 @@ void decode() {
quitDecode
(
pc
,
dc
);
return
;
}
usleep
(
10
);
usleep
(
10
00
);
}
if
(
pc
->
queueState
!=
PLAYER_QUEUE_PLAY
)
{
quit
=
1
;
...
...
src/player.c
View file @
be753fb5
...
...
@@ -194,7 +194,7 @@ int playerPlay(FILE * fp, char * utf8file) {
return
-
1
;
}
while
(
player_pid
>
0
&&
pc
->
play
)
usleep
(
10
);
while
(
player_pid
>
0
&&
pc
->
play
)
usleep
(
10
00
);
return
0
;
}
...
...
@@ -204,7 +204,7 @@ int playerStop(FILE * fp) {
if
(
player_pid
>
0
&&
pc
->
state
!=
PLAYER_STATE_STOP
)
{
pc
->
stop
=
1
;
while
(
player_pid
>
0
&&
pc
->
stop
)
usleep
(
10
);
while
(
player_pid
>
0
&&
pc
->
stop
)
usleep
(
10
00
);
}
pc
->
queueState
=
PLAYER_QUEUE_BLANK
;
...
...
@@ -230,7 +230,7 @@ int playerPause(FILE * fp) {
if
(
player_pid
>
0
&&
pc
->
state
!=
PLAYER_STATE_STOP
)
{
pc
->
pause
=
1
;
while
(
player_pid
>
0
&&
pc
->
pause
)
usleep
(
10
);
while
(
player_pid
>
0
&&
pc
->
pause
)
usleep
(
10
00
);
}
return
0
;
...
...
@@ -361,7 +361,7 @@ void playerQueueLock() {
if
(
player_pid
>
0
&&
pc
->
queueLockState
==
PLAYER_QUEUE_UNLOCKED
)
{
pc
->
lockQueue
=
1
;
while
(
player_pid
>
0
&&
pc
->
lockQueue
)
usleep
(
10
);
while
(
player_pid
>
0
&&
pc
->
lockQueue
)
usleep
(
10
00
);
}
}
...
...
@@ -371,7 +371,7 @@ void playerQueueUnlock() {
if
(
player_pid
>
0
&&
pc
->
queueLockState
==
PLAYER_QUEUE_LOCKED
)
{
pc
->
unlockQueue
=
1
;
while
(
player_pid
>
0
&&
pc
->
unlockQueue
)
usleep
(
10
);
while
(
player_pid
>
0
&&
pc
->
unlockQueue
)
usleep
(
10
00
);
}
}
...
...
@@ -394,7 +394,7 @@ int playerSeek(FILE * fp, char * utf8file, float time) {
if
(
pc
->
error
==
PLAYER_ERROR_NOERROR
)
{
pc
->
seekWhere
=
time
;
pc
->
seek
=
1
;
while
(
player_pid
>
0
&&
pc
->
seek
)
usleep
(
10
);
while
(
player_pid
>
0
&&
pc
->
seek
)
usleep
(
10
00
);
}
return
0
;
...
...
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