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
4404f20c
Commit
4404f20c
authored
Nov 11, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Control: Seek*() returns Error information
parent
faca8bc0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
Control.cxx
src/player/Control.cxx
+15
-4
Control.hxx
src/player/Control.hxx
+2
-2
PlaylistControl.cxx
src/queue/PlaylistControl.cxx
+1
-5
No files found.
src/player/Control.cxx
View file @
4404f20c
...
...
@@ -204,8 +204,8 @@ PlayerControl::LockEnqueueSong(DetachedSong *song)
EnqueueSongLocked
(
song
);
}
void
PlayerControl
::
SeekLocked
(
DetachedSong
*
song
,
SongTime
t
)
bool
PlayerControl
::
SeekLocked
(
DetachedSong
*
song
,
SongTime
t
,
Error
&
error_r
)
{
assert
(
song
!=
nullptr
);
...
...
@@ -214,21 +214,32 @@ PlayerControl::SeekLocked(DetachedSong *song, SongTime t)
assert
(
next_song
==
nullptr
);
ClearError
();
next_song
=
song
;
seek_time
=
t
;
SynchronousCommand
(
PlayerCommand
::
SEEK
);
assert
(
next_song
==
nullptr
);
if
(
error_type
!=
PlayerError
::
NONE
)
{
assert
(
error
.
IsDefined
());
error_r
.
Set
(
error
);
return
false
;
}
assert
(
!
error
.
IsDefined
());
return
true
;
}
bool
PlayerControl
::
LockSeek
(
DetachedSong
*
song
,
SongTime
t
)
PlayerControl
::
LockSeek
(
DetachedSong
*
song
,
SongTime
t
,
Error
&
error_r
)
{
assert
(
song
!=
nullptr
);
{
const
ScopeLock
protect
(
mutex
);
SeekLocked
(
song
,
t
);
if
(
!
SeekLocked
(
song
,
t
,
error_r
))
return
false
;
}
idle_add
(
IDLE_PLAYER
);
...
...
src/player/Control.hxx
View file @
4404f20c
...
...
@@ -425,7 +425,7 @@ private:
SynchronousCommand
(
PlayerCommand
::
QUEUE
);
}
void
SeekLocked
(
DetachedSong
*
song
,
SongTime
t
);
bool
SeekLocked
(
DetachedSong
*
song
,
SongTime
t
,
Error
&
error_r
);
public
:
/**
...
...
@@ -442,7 +442,7 @@ public:
* @return true on success, false on failure (e.g. if MPD isn't
* playing currently)
*/
bool
LockSeek
(
DetachedSong
*
song
,
SongTime
t
);
bool
LockSeek
(
DetachedSong
*
song
,
SongTime
t
,
Error
&
error_r
);
void
SetCrossFade
(
float
cross_fade_seconds
);
...
...
src/queue/PlaylistControl.cxx
View file @
4404f20c
...
...
@@ -211,12 +211,8 @@ playlist::SeekSongOrder(PlayerControl &pc, unsigned i, SongTime seek_time,
queued_song
=
nullptr
;
}
if
(
!
pc
.
LockSeek
(
new
DetachedSong
(
queue
.
GetOrder
(
i
)),
seek_time
))
{
if
(
!
pc
.
LockSeek
(
new
DetachedSong
(
queue
.
GetOrder
(
i
)),
seek_time
,
error
))
{
UpdateQueuedSong
(
pc
,
queued_song
);
// TODO: fix error code
error
.
Set
(
playlist_domain
,
int
(
PlaylistResult
::
NOT_PLAYING
),
"Decoder failed to seek"
);
return
false
;
}
...
...
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