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
2a07354c
Commit
2a07354c
authored
5 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mad: change integers to size_t
parent
fc18fd57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
MadDecoderPlugin.cxx
src/decoder/plugins/MadDecoderPlugin.cxx
+14
-14
No files found.
src/decoder/plugins/MadDecoderPlugin.cxx
View file @
2a07354c
...
...
@@ -90,10 +90,10 @@ mad_fixed_to_24_sample(mad_fixed_t sample) noexcept
static
void
mad_fixed_to_24_buffer
(
int32_t
*
dest
,
const
struct
mad_pcm
&
src
,
unsigned
int
start
,
unsigned
in
t
end
,
size_t
start
,
size_
t
end
,
unsigned
int
num_channels
)
{
for
(
unsigned
i
=
start
;
i
<
end
;
++
i
)
for
(
size_t
i
=
start
;
i
<
end
;
++
i
)
for
(
unsigned
c
=
0
;
c
<
num_channels
;
++
c
)
*
dest
++
=
mad_fixed_to_24_sample
(
src
.
samples
[
c
][
i
]);
}
...
...
@@ -121,9 +121,9 @@ class MadDecoder {
MadDecoderMuteFrame
mute_frame
=
MadDecoderMuteFrame
::
NONE
;
long
*
frame_offsets
=
nullptr
;
mad_timer_t
*
times
=
nullptr
;
unsigned
long
highest_frame
=
0
;
unsigned
long
max_frames
=
0
;
unsigned
long
current_frame
=
0
;
size_t
highest_frame
=
0
;
size_t
max_frames
=
0
;
size_t
current_frame
=
0
;
unsigned
int
drop_start_frames
;
unsigned
int
drop_end_frames
;
unsigned
int
drop_start_samples
=
0
;
...
...
@@ -180,7 +180,7 @@ private:
}
gcc_pure
long
TimeToFrame
(
SongTime
t
)
const
noexcept
;
size_t
TimeToFrame
(
SongTime
t
)
const
noexcept
;
/**
* Record the current frame's offset in the "frame_offsets"
...
...
@@ -193,7 +193,7 @@ private:
* Sends the synthesized current frame via
* DecoderClient::SubmitData().
*/
DecoderCommand
SubmitPCM
(
unsigned
i
,
unsigned
pcm_length
)
noexcept
;
DecoderCommand
SubmitPCM
(
size_t
start
,
size_t
n
)
noexcept
;
/**
* Synthesize the current frame and send it via
...
...
@@ -804,10 +804,10 @@ MadDecoder::~MadDecoder() noexcept
delete
[]
times
;
}
long
size_t
MadDecoder
::
TimeToFrame
(
SongTime
t
)
const
noexcept
{
unsigned
long
i
;
size_t
i
;
for
(
i
=
0
;
i
<
highest_frame
;
++
i
)
{
auto
frame_time
=
ToSongTime
(
times
[
i
]);
...
...
@@ -844,9 +844,9 @@ MadDecoder::UpdateTimerNextFrame() noexcept
}
DecoderCommand
MadDecoder
::
SubmitPCM
(
unsigned
i
,
unsigned
pcm_length
)
noexcept
MadDecoder
::
SubmitPCM
(
size_t
i
,
size_t
pcm_length
)
noexcept
{
unsigned
in
t
num_samples
=
pcm_length
-
i
;
size_
t
num_samples
=
pcm_length
-
i
;
mad_fixed_to_24_buffer
(
output_buffer
,
synth
.
pcm
,
i
,
i
+
num_samples
,
...
...
@@ -882,13 +882,13 @@ MadDecoder::SynthAndSubmit() noexcept
return
DecoderCommand
::
STOP
;
}
unsigned
i
=
0
;
size_t
i
=
0
;
if
(
!
decoded_first_frame
)
{
i
=
drop_start_samples
;
decoded_first_frame
=
true
;
}
unsigned
pcm_length
=
synth
.
pcm
.
length
;
size_t
pcm_length
=
synth
.
pcm
.
length
;
if
(
drop_end_samples
&&
current_frame
==
max_frames
-
drop_end_frames
-
1
)
{
if
(
drop_end_samples
>=
pcm_length
)
...
...
@@ -931,7 +931,7 @@ MadDecoder::HandleCurrentFrame() noexcept
assert
(
input_stream
.
IsSeekable
());
const
auto
t
=
client
->
GetSeekTime
();
unsigned
long
j
=
TimeToFrame
(
t
);
size_t
j
=
TimeToFrame
(
t
);
if
(
j
<
highest_frame
)
{
if
(
Seek
(
frame_offsets
[
j
]))
{
current_frame
=
j
;
...
...
This diff is collapsed.
Click to expand it.
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