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
eaa9a1e3
Commit
eaa9a1e3
authored
Jul 11, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sndfile: make variables more local
parent
3e19298c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
SndfileDecoderPlugin.cxx
src/decoder/plugins/SndfileDecoderPlugin.cxx
+7
-10
No files found.
src/decoder/plugins/SndfileDecoderPlugin.cxx
View file @
eaa9a1e3
...
...
@@ -155,16 +155,12 @@ time_to_frame(float t, const AudioFormat *audio_format)
static
void
sndfile_stream_decode
(
Decoder
&
decoder
,
InputStream
&
is
)
{
SNDFILE
*
sf
;
SF_INFO
info
;
size_t
frame_size
;
sf_count_t
read_frames
,
num_frames
;
int
buffer
[
4096
];
info
.
format
=
0
;
SndfileInputStream
sis
{
&
decoder
,
is
};
sf
=
sf_open_virtual
(
&
vio
,
SFM_READ
,
&
info
,
&
sis
);
SNDFILE
*
const
sf
=
sf_open_virtual
(
&
vio
,
SFM_READ
,
&
info
,
&
sis
);
if
(
sf
==
nullptr
)
{
LogWarning
(
sndfile_domain
,
"sf_open_virtual() failed"
);
return
;
...
...
@@ -185,12 +181,14 @@ sndfile_stream_decode(Decoder &decoder, InputStream &is)
decoder_initialized
(
decoder
,
audio_format
,
info
.
seekable
,
frame_to_time
(
info
.
frames
,
&
audio_format
));
frame_size
=
audio_format
.
GetFrameSize
();
read_frames
=
sizeof
(
buffer
)
/
frame_size
;
int
buffer
[
4096
];
const
size_t
frame_size
=
audio_format
.
GetFrameSize
();
const
sf_count_t
read_frames
=
sizeof
(
buffer
)
/
frame_size
;
DecoderCommand
cmd
;
do
{
num_frames
=
sf_readf_int
(
sf
,
buffer
,
read_frames
);
sf_count_t
num_frames
=
sf_readf_int
(
sf
,
buffer
,
read_frames
);
if
(
num_frames
<=
0
)
break
;
...
...
@@ -239,12 +237,11 @@ static bool
sndfile_scan_file
(
Path
path_fs
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
SNDFILE
*
sf
;
SF_INFO
info
;
info
.
format
=
0
;
sf
=
sf_open
(
path_fs
.
c_str
(),
SFM_READ
,
&
info
);
SNDFILE
*
const
sf
=
sf_open
(
path_fs
.
c_str
(),
SFM_READ
,
&
info
);
if
(
sf
==
nullptr
)
return
false
;
...
...
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