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
faca8bc0
Commit
faca8bc0
authored
Nov 11, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Control: Seek() returns Error information
parent
5e93c050
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
DecoderControl.cxx
src/decoder/DecoderControl.cxx
+14
-3
DecoderControl.hxx
src/decoder/DecoderControl.hxx
+1
-1
Thread.cxx
src/player/Thread.cxx
+3
-1
No files found.
src/decoder/DecoderControl.cxx
View file @
faca8bc0
...
...
@@ -19,6 +19,7 @@
#include "config.h"
#include "DecoderControl.hxx"
#include "DecoderError.hxx"
#include "MusicPipe.hxx"
#include "DetachedSong.hxx"
...
...
@@ -105,7 +106,7 @@ DecoderControl::Stop()
}
bool
DecoderControl
::
Seek
(
SongTime
t
)
DecoderControl
::
Seek
(
SongTime
t
,
Error
&
error_r
)
{
assert
(
state
!=
DecoderState
::
START
);
assert
(
state
!=
DecoderState
::
ERROR
);
...
...
@@ -116,20 +117,30 @@ DecoderControl::Seek(SongTime t)
gcc_unreachable
();
case
DecoderState
:
:
STOP
:
/* TODO: if this happens, the caller should be given a
chance to restart the decoder */
error_r
.
Set
(
decoder_domain
,
"Decoder is dead"
);
return
false
;
case
DecoderState
:
:
DECODE
:
break
;
}
if
(
!
seekable
)
if
(
!
seekable
)
{
error_r
.
Set
(
decoder_domain
,
"Not seekable"
);
return
false
;
}
seek_time
=
t
;
seek_error
=
false
;
LockSynchronousCommand
(
DecoderCommand
::
SEEK
);
return
!
seek_error
;
if
(
seek_error
)
{
error_r
.
Set
(
decoder_domain
,
"Decoder failed to seek"
);
return
false
;
}
return
true
;
}
void
...
...
src/decoder/DecoderControl.hxx
View file @
faca8bc0
...
...
@@ -365,7 +365,7 @@ public:
void
Stop
();
bool
Seek
(
SongTime
t
);
bool
Seek
(
SongTime
t
,
Error
&
error_r
);
void
Quit
();
...
...
src/player/Thread.cxx
View file @
faca8bc0
...
...
@@ -605,8 +605,10 @@ Player::SeekDecoder()
where
=
total_time
;
}
if
(
!
dc
.
Seek
(
where
+
start_time
))
{
Error
error
;
if
(
!
dc
.
Seek
(
where
+
start_time
,
error
))
{
/* decoder failure */
pc
.
SetError
(
PlayerError
::
DECODER
,
std
::
move
(
error
));
pc
.
LockCommandFinished
();
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