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
ba6ba7d4
Commit
ba6ba7d4
authored
Aug 27, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoderControl: use std::chrono::duration for Seek()
parent
58e6f660
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
PlayerThread.cxx
src/PlayerThread.cxx
+1
-1
DecoderAPI.cxx
src/decoder/DecoderAPI.cxx
+3
-3
DecoderControl.cxx
src/decoder/DecoderControl.cxx
+2
-3
DecoderControl.hxx
src/decoder/DecoderControl.hxx
+3
-2
DecoderInternal.hxx
src/decoder/DecoderInternal.hxx
+1
-1
No files found.
src/PlayerThread.cxx
View file @
ba6ba7d4
...
...
@@ -567,7 +567,7 @@ Player::SeekDecoder()
if
(
where
<
0.0
)
where
=
0.0
;
if
(
!
dc
.
Seek
(
where
+
start_ms
/
1000.0
))
{
if
(
!
dc
.
Seek
(
SongTime
::
FromS
(
where
)
+
SongTime
::
FromMS
(
start_ms
)
))
{
/* decoder failure */
player_command_finished
(
pc
);
return
false
;
...
...
src/decoder/DecoderAPI.cxx
View file @
ba6ba7d4
...
...
@@ -196,7 +196,7 @@ decoder_command_finished(Decoder &decoder)
dc
.
pipe
->
Clear
(
*
dc
.
buffer
);
decoder
.
timestamp
=
dc
.
seek_
where
;
decoder
.
timestamp
=
dc
.
seek_
time
.
ToDoubleS
()
;
}
dc
.
command
=
DecoderCommand
::
NONE
;
...
...
@@ -218,7 +218,7 @@ decoder_seek_time(Decoder &decoder)
decoder
.
seeking
=
true
;
return
SongTime
::
FromS
(
dc
.
seek_where
)
;
return
dc
.
seek_time
;
}
uint64_t
...
...
@@ -236,7 +236,7 @@ decoder_seek_where_frame(Decoder &decoder)
decoder
.
seeking
=
true
;
return
uint64_t
(
dc
.
seek_where
*
dc
.
in_audio_format
.
sample_rate
);
return
dc
.
seek_time
.
ToScale
<
uint64_t
>
(
dc
.
in_audio_format
.
sample_rate
);
}
void
decoder_seek_error
(
Decoder
&
decoder
)
...
...
src/decoder/DecoderControl.cxx
View file @
ba6ba7d4
...
...
@@ -105,16 +105,15 @@ DecoderControl::Stop()
}
bool
DecoderControl
::
Seek
(
double
where
)
DecoderControl
::
Seek
(
SongTime
t
)
{
assert
(
state
!=
DecoderState
::
START
);
assert
(
where
>=
0.0
);
if
(
state
==
DecoderState
::
STOP
||
state
==
DecoderState
::
ERROR
||
!
seekable
)
return
false
;
seek_
where
=
where
;
seek_
time
=
t
;
seek_error
=
false
;
LockSynchronousCommand
(
DecoderCommand
::
SEEK
);
...
...
src/decoder/DecoderControl.hxx
View file @
ba6ba7d4
...
...
@@ -26,6 +26,7 @@
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
#include "thread/Thread.hxx"
#include "Chrono.hxx"
#include "util/Error.hxx"
#include <assert.h>
...
...
@@ -107,7 +108,7 @@ struct DecoderControl {
bool
seek_error
;
bool
seekable
;
double
seek_wher
e
;
SongTime
seek_tim
e
;
/** the format of the song file */
AudioFormat
in_audio_format
;
...
...
@@ -365,7 +366,7 @@ public:
void
Stop
();
bool
Seek
(
double
where
);
bool
Seek
(
SongTime
t
);
void
Quit
();
...
...
src/decoder/DecoderInternal.hxx
View file @
ba6ba7d4
...
...
@@ -57,7 +57,7 @@ struct Decoder {
bool
initial_seek_running
;
/**
* This flag is set by decoder_seek_
wher
e(), and checked by
* This flag is set by decoder_seek_
tim
e(), and checked by
* decoder_command_finished(). It is used to clean up after
* seeking.
*/
...
...
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