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
45fbafae
Commit
45fbafae
authored
Apr 24, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/pcm: split variable "frame_size" in "in_*" and "out_*"
parent
803b73a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
PcmDecoderPlugin.cxx
src/decoder/plugins/PcmDecoderPlugin.cxx
+5
-4
No files found.
src/decoder/plugins/PcmDecoderPlugin.cxx
View file @
45fbafae
...
...
@@ -136,10 +136,11 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
return
;
}
const
auto
frame_size
=
audio_format
.
GetFrameSize
();
const
auto
out_frame_size
=
audio_format
.
GetFrameSize
();
const
auto
in_frame_size
=
out_frame_size
;
const
auto
total_time
=
is
.
KnownSize
()
?
SignedSongTime
::
FromScale
<
uint64_t
>
(
is
.
GetSize
()
/
frame_size
,
?
SignedSongTime
::
FromScale
<
uint64_t
>
(
is
.
GetSize
()
/
in_
frame_size
,
audio_format
.
sample_rate
)
:
SignedSongTime
::
Negative
();
...
...
@@ -156,7 +157,7 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
/* round down to the nearest frame size, because we
must not pass partial frames to
DecoderClient::SubmitData() */
r
.
size
-=
r
.
size
%
frame_size
;
r
.
size
-=
r
.
size
%
in_
frame_size
;
buffer
.
Consume
(
r
.
size
);
if
(
reverse_endian
)
...
...
@@ -170,7 +171,7 @@ pcm_stream_decode(DecoderClient &client, InputStream &is)
:
client
.
GetCommand
();
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
uint64_t
frame
=
client
.
GetSeekFrame
();
offset_type
offset
=
frame
*
frame_size
;
offset_type
offset
=
frame
*
in_
frame_size
;
try
{
is
.
LockSeek
(
offset
);
...
...
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