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
147d301f
Commit
147d301f
authored
Aug 29, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MultipleOutputs: use SignedSongTime for elapsed_time
parent
75a89c59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
PlayerThread.cxx
src/PlayerThread.cxx
+2
-2
MultipleOutputs.cxx
src/output/MultipleOutputs.cxx
+6
-6
MultipleOutputs.hxx
src/output/MultipleOutputs.hxx
+3
-2
No files found.
src/PlayerThread.cxx
View file @
147d301f
...
...
@@ -674,8 +674,8 @@ Player::ProcessCommand()
pc
.
Lock
();
}
pc
.
elapsed_time
=
pc
.
outputs
.
GetElapsedTime
()
>=
0
?
SongTime
::
FromS
(
pc
.
outputs
.
GetElapsedTime
())
pc
.
elapsed_time
=
!
pc
.
outputs
.
GetElapsedTime
().
IsNegative
()
?
SongTime
(
pc
.
outputs
.
GetElapsedTime
())
:
elapsed_time
;
pc
.
CommandFinished
();
...
...
src/output/MultipleOutputs.cxx
View file @
147d301f
...
...
@@ -39,7 +39,7 @@ MultipleOutputs::MultipleOutputs(MixerListener &_mixer_listener)
:
mixer_listener
(
_mixer_listener
),
input_audio_format
(
AudioFormat
::
Undefined
()),
buffer
(
nullptr
),
pipe
(
nullptr
),
elapsed_time
(
-
1
)
elapsed_time
(
SignedSongTime
::
Negative
()
)
{
}
...
...
@@ -344,7 +344,7 @@ MultipleOutputs::Check()
if
(
chunk
->
length
>
0
&&
chunk
->
times
>=
0.0
)
/* only update elapsed_time if the chunk
provides a defined value */
elapsed_time
=
chunk
->
times
;
elapsed_time
=
SignedSongTime
::
FromS
(
chunk
->
times
)
;
is_tail
=
chunk
->
next
==
nullptr
;
if
(
is_tail
)
...
...
@@ -428,7 +428,7 @@ MultipleOutputs::Cancel()
/* invalidate elapsed_time */
elapsed_time
=
-
1.0
;
elapsed_time
=
SignedSongTime
::
Negative
()
;
}
void
...
...
@@ -449,7 +449,7 @@ MultipleOutputs::Close()
input_audio_format
.
Clear
();
elapsed_time
=
-
1.0
;
elapsed_time
=
SignedSongTime
::
Negative
()
;
}
void
...
...
@@ -470,7 +470,7 @@ MultipleOutputs::Release()
input_audio_format
.
Clear
();
elapsed_time
=
-
1.0
;
elapsed_time
=
SignedSongTime
::
Negative
()
;
}
void
...
...
@@ -478,5 +478,5 @@ MultipleOutputs::SongBorder()
{
/* clear the elapsed_time pointer at the beginning of a new
song */
elapsed_time
=
0.0
;
elapsed_time
=
SignedSongTime
::
zero
()
;
}
src/output/MultipleOutputs.hxx
View file @
147d301f
...
...
@@ -28,6 +28,7 @@
#include "AudioFormat.hxx"
#include "ReplayGainInfo.hxx"
#include "Chrono.hxx"
#include "Compiler.h"
#include <vector>
...
...
@@ -66,7 +67,7 @@ class MultipleOutputs {
* The "elapsed_time" stamp of the most recently finished
* chunk.
*/
float
elapsed_time
;
SignedSongTime
elapsed_time
;
public
:
/**
...
...
@@ -194,7 +195,7 @@ public:
* finished yet.
*/
gcc_pure
float
GetElapsedTime
()
const
{
SignedSongTime
GetElapsedTime
()
const
{
return
elapsed_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