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
316c72a4
Commit
316c72a4
authored
Aug 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoderAPI: add decoder_seek_where_ms()
Move to fixed-point integers instead of floating point.
parent
9da88eec
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
DecoderAPI.cxx
src/decoder/DecoderAPI.cxx
+17
-0
DecoderAPI.hxx
src/decoder/DecoderAPI.hxx
+10
-0
FakeDecoderAPI.cxx
test/FakeDecoderAPI.cxx
+6
-0
No files found.
src/decoder/DecoderAPI.cxx
View file @
316c72a4
...
@@ -220,6 +220,23 @@ double decoder_seek_where(gcc_unused Decoder & decoder)
...
@@ -220,6 +220,23 @@ double decoder_seek_where(gcc_unused Decoder & decoder)
return
dc
.
seek_where
;
return
dc
.
seek_where
;
}
}
unsigned
decoder_seek_where_ms
(
Decoder
&
decoder
)
{
const
DecoderControl
&
dc
=
decoder
.
dc
;
assert
(
dc
.
pipe
!=
nullptr
);
if
(
decoder
.
initial_seek_running
)
return
dc
.
start_ms
;
assert
(
dc
.
command
==
DecoderCommand
::
SEEK
);
decoder
.
seeking
=
true
;
return
unsigned
(
dc
.
seek_where
*
1000
);
}
void
decoder_seek_error
(
Decoder
&
decoder
)
void
decoder_seek_error
(
Decoder
&
decoder
)
{
{
DecoderControl
&
dc
=
decoder
.
dc
;
DecoderControl
&
dc
=
decoder
.
dc
;
...
...
src/decoder/DecoderAPI.hxx
View file @
316c72a4
...
@@ -89,6 +89,16 @@ double
...
@@ -89,6 +89,16 @@ double
decoder_seek_where
(
Decoder
&
decoder
);
decoder_seek_where
(
Decoder
&
decoder
);
/**
/**
* Call this when you have received the DecoderCommand::SEEK command.
*
* @param decoder the decoder object
* @return the destination position for the seek in milliseconds
*/
gcc_pure
unsigned
decoder_seek_where_ms
(
Decoder
&
decoder
);
/**
* Call this instead of decoder_command_finished() when seeking has
* Call this instead of decoder_command_finished() when seeking has
* failed.
* failed.
*
*
...
...
test/FakeDecoderAPI.cxx
View file @
316c72a4
...
@@ -61,6 +61,12 @@ decoder_seek_where(gcc_unused Decoder &decoder)
...
@@ -61,6 +61,12 @@ decoder_seek_where(gcc_unused Decoder &decoder)
return
1.0
;
return
1.0
;
}
}
unsigned
decoder_seek_where_ms
(
gcc_unused
Decoder
&
decoder
)
{
return
1
;
}
void
void
decoder_seek_error
(
gcc_unused
Decoder
&
decoder
)
decoder_seek_error
(
gcc_unused
Decoder
&
decoder
)
{
{
...
...
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