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
b616dff7
Commit
b616dff7
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no commandError() in playerSeek()
We should avoid having protocol specific code in player.c. Just return success or failure, and let the caller send the error code to the MPD client.
parent
bf4af19f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
player.c
src/player.c
+2
-6
player.h
src/player.h
+1
-1
playlist.c
src/playlist.c
+6
-2
No files found.
src/player.c
View file @
b616dff7
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include "player.h"
#include "player.h"
#include "player_thread.h"
#include "player_thread.h"
#include "path.h"
#include "path.h"
#include "command.h"
#include "ack.h"
#include "ack.h"
#include "os_compat.h"
#include "os_compat.h"
#include "main_notify.h"
#include "main_notify.h"
...
@@ -197,15 +196,12 @@ void playerQueueUnlock(void)
...
@@ -197,15 +196,12 @@ void playerQueueUnlock(void)
assert
(
pc
.
queueLockState
==
PLAYER_QUEUE_UNLOCKED
);
assert
(
pc
.
queueLockState
==
PLAYER_QUEUE_UNLOCKED
);
}
}
int
playerSeek
(
int
fd
,
Song
*
song
,
float
seek_time
)
int
playerSeek
(
Song
*
song
,
float
seek_time
)
{
{
assert
(
song
!=
NULL
);
assert
(
song
!=
NULL
);
if
(
pc
.
state
==
PLAYER_STATE_STOP
)
{
if
(
pc
.
state
==
PLAYER_STATE_STOP
)
commandError
(
fd
,
ACK_ERROR_PLAYER_SYNC
,
"player not currently playing"
);
return
-
1
;
return
-
1
;
}
if
(
pc
.
next_song
!=
song
)
if
(
pc
.
next_song
!=
song
)
set_current_song
(
song
);
set_current_song
(
song
);
...
...
src/player.h
View file @
b616dff7
...
@@ -139,7 +139,7 @@ void playerQueueLock(void);
...
@@ -139,7 +139,7 @@ void playerQueueLock(void);
void
playerQueueUnlock
(
void
);
void
playerQueueUnlock
(
void
);
int
playerSeek
(
int
fd
,
Song
*
song
,
float
seek_time
);
int
playerSeek
(
Song
*
song
,
float
seek_time
);
void
setPlayerCrossFade
(
float
crossFadeInSeconds
);
void
setPlayerCrossFade
(
float
crossFadeInSeconds
);
...
...
src/playlist.c
View file @
b616dff7
...
@@ -1354,7 +1354,7 @@ int getPlaylistLength(void)
...
@@ -1354,7 +1354,7 @@ int getPlaylistLength(void)
int
seekSongInPlaylist
(
int
fd
,
int
song
,
float
seek_time
)
int
seekSongInPlaylist
(
int
fd
,
int
song
,
float
seek_time
)
{
{
int
i
;
int
i
,
ret
;
if
(
song
<
0
||
song
>=
playlist
.
length
)
{
if
(
song
<
0
||
song
>=
playlist
.
length
)
{
commandError
(
fd
,
ACK_ERROR_NO_EXIST
,
commandError
(
fd
,
ACK_ERROR_NO_EXIST
,
...
@@ -1381,7 +1381,11 @@ int seekSongInPlaylist(int fd, int song, float seek_time)
...
@@ -1381,7 +1381,11 @@ int seekSongInPlaylist(int fd, int song, float seek_time)
playPlaylistOrderNumber
(
i
);
playPlaylistOrderNumber
(
i
);
}
}
return
playerSeek
(
fd
,
playlist
.
songs
[
playlist
.
order
[
i
]],
seek_time
);
ret
=
playerSeek
(
playlist
.
songs
[
playlist
.
order
[
i
]],
seek_time
);
if
(
ret
<
0
)
commandError
(
fd
,
ACK_ERROR_PLAYER_SYNC
,
"player not currently playing"
);
return
ret
;
}
}
int
seekSongInPlaylistById
(
int
fd
,
int
id
,
float
seek_time
)
int
seekSongInPlaylistById
(
int
fd
,
int
id
,
float
seek_time
)
...
...
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