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
d35d2b26
Commit
d35d2b26
authored
Aug 08, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player_control: rename player_error enum values
parent
fa84ed41
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
player_control.c
src/player_control.c
+6
-6
player_control.h
src/player_control.h
+11
-3
player_thread.c
src/player_thread.c
+4
-4
playlist.c
src/playlist.c
+3
-3
No files found.
src/player_control.c
View file @
d35d2b26
...
...
@@ -47,7 +47,7 @@ pc_new(unsigned buffer_chunks, unsigned int buffered_before_play)
pc
->
cond
=
g_cond_new
();
pc
->
command
=
PLAYER_COMMAND_NONE
;
pc
->
error
=
PLAYER_ERROR_NO
ERROR
;
pc
->
error
=
PLAYER_ERROR_NO
NE
;
pc
->
state
=
PLAYER_STATE_STOP
;
pc
->
cross_fade_seconds
=
0
;
pc
->
mixramp_db
=
0
;
...
...
@@ -80,7 +80,7 @@ void
pc_song_deleted
(
struct
player_control
*
pc
,
const
struct
song
*
song
)
{
if
(
pc
->
errored_song
==
song
)
{
pc
->
error
=
PLAYER_ERROR_NO
ERROR
;
pc
->
error
=
PLAYER_ERROR_NO
NE
;
pc
->
errored_song
=
NULL
;
}
}
...
...
@@ -232,7 +232,7 @@ void
pc_clear_error
(
struct
player_control
*
pc
)
{
player_lock
(
pc
);
pc
->
error
=
PLAYER_ERROR_NO
ERROR
;
pc
->
error
=
PLAYER_ERROR_NO
NE
;
pc
->
errored_song
=
NULL
;
player_unlock
(
pc
);
}
...
...
@@ -250,16 +250,16 @@ pc_get_error_message(struct player_control *pc)
char
*
uri
;
switch
(
pc
->
error
)
{
case
PLAYER_ERROR_NO
ERROR
:
case
PLAYER_ERROR_NO
NE
:
return
NULL
;
case
PLAYER_ERROR_
FILE
:
case
PLAYER_ERROR_
DECODER
:
uri
=
pc_errored_song_uri
(
pc
);
error
=
g_strdup_printf
(
"problems decoding
\"
%s
\"
"
,
uri
);
g_free
(
uri
);
return
error
;
case
PLAYER_ERROR_
AUDIO
:
case
PLAYER_ERROR_
OUTPUT
:
return
g_strdup
(
"problems opening audio device"
);
}
...
...
src/player_control.h
View file @
d35d2b26
...
...
@@ -66,9 +66,17 @@ enum player_command {
};
enum
player_error
{
PLAYER_ERROR_NOERROR
=
0
,
PLAYER_ERROR_FILE
,
PLAYER_ERROR_AUDIO
,
PLAYER_ERROR_NONE
=
0
,
/**
* The decoder has failed to decode the song.
*/
PLAYER_ERROR_DECODER
,
/**
* The audio output has failed.
*/
PLAYER_ERROR_OUTPUT
,
};
struct
player_status
{
...
...
src/player_thread.c
View file @
d35d2b26
...
...
@@ -238,7 +238,7 @@ player_wait_for_decoder(struct player *player)
if
(
decoder_lock_has_failed
(
dc
))
{
player_lock
(
pc
);
pc
->
errored_song
=
dc
->
song
;
pc
->
error
=
PLAYER_ERROR_
FILE
;
pc
->
error
=
PLAYER_ERROR_
DECODER
;
pc
->
next_song
=
NULL
;
player_unlock
(
pc
);
...
...
@@ -322,7 +322,7 @@ player_open_output(struct player *player)
player
->
paused
=
true
;
player_lock
(
pc
);
pc
->
error
=
PLAYER_ERROR_
AUDIO
;
pc
->
error
=
PLAYER_ERROR_
OUTPUT
;
pc
->
state
=
PLAYER_STATE_PAUSE
;
player_unlock
(
pc
);
...
...
@@ -353,7 +353,7 @@ player_check_decoder_startup(struct player *player)
player_lock
(
pc
);
pc
->
errored_song
=
dc
->
song
;
pc
->
error
=
PLAYER_ERROR_
FILE
;
pc
->
error
=
PLAYER_ERROR_
DECODER
;
player_unlock
(
pc
);
return
false
;
...
...
@@ -789,7 +789,7 @@ play_next_chunk(struct player *player)
player_lock
(
pc
);
pc
->
error
=
PLAYER_ERROR_
AUDIO
;
pc
->
error
=
PLAYER_ERROR_
OUTPUT
;
/* pause: the user may resume playback as soon as an
audio output becomes available */
...
...
src/playlist.c
View file @
d35d2b26
...
...
@@ -259,13 +259,13 @@ playlist_resume_playback(struct playlist *playlist, struct player_control *pc)
assert
(
pc_get_state
(
pc
)
==
PLAYER_STATE_STOP
);
error
=
pc_get_error
(
pc
);
if
(
error
==
PLAYER_ERROR_NO
ERROR
)
if
(
error
==
PLAYER_ERROR_NO
NE
)
playlist
->
error_count
=
0
;
else
++
playlist
->
error_count
;
if
((
playlist
->
stop_on_error
&&
error
!=
PLAYER_ERROR_NO
ERROR
)
||
error
==
PLAYER_ERROR_
AUDIO
||
if
((
playlist
->
stop_on_error
&&
error
!=
PLAYER_ERROR_NO
NE
)
||
error
==
PLAYER_ERROR_
OUTPUT
||
playlist
->
error_count
>=
queue_length
(
&
playlist
->
queue
))
/* too many errors, or critical error: stop
playback */
...
...
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