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
d1862600
Commit
d1862600
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use break instead of local variable "eof"
Similar to previous patch: eliminate one variable by using "break". This also simplifies the code since we can remove one level of indent.
parent
4c066249
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
audiofile_plugin.c
src/inputPlugins/audiofile_plugin.c
+12
-16
No files found.
src/inputPlugins/audiofile_plugin.c
View file @
d1862600
...
...
@@ -88,10 +88,10 @@ static int audiofile_decode(struct decoder * decoder, char *path)
decoder_initialized
(
decoder
,
&
audio_format
,
total_time
);
{
int
ret
,
eof
=
0
,
current
=
0
;
int
ret
,
current
=
0
;
char
chunk
[
CHUNK_SIZE
];
while
(
!
eof
)
{
do
{
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
{
decoder_clear
(
decoder
);
current
=
dc
.
seekWhere
*
...
...
@@ -104,20 +104,16 @@ static int audiofile_decode(struct decoder * decoder, char *path)
afReadFrames
(
af_fp
,
AF_DEFAULT_TRACK
,
chunk
,
CHUNK_SIZE
/
fs
);
if
(
ret
<=
0
)
eof
=
1
;
else
{
current
+=
ret
;
decoder_data
(
decoder
,
NULL
,
1
,
chunk
,
ret
*
fs
,
(
float
)
current
/
(
float
)
audio_format
.
sampleRate
,
bitRate
,
NULL
);
if
(
dc
.
command
==
DECODE_COMMAND_STOP
)
break
;
}
}
current
+=
ret
;
decoder_data
(
decoder
,
NULL
,
1
,
chunk
,
ret
*
fs
,
(
float
)
current
/
(
float
)
audio_format
.
sampleRate
,
bitRate
,
NULL
);
}
while
(
dc
.
command
!=
DECODE_COMMAND_STOP
);
decoder_flush
(
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