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
5b13f067
Commit
5b13f067
authored
Nov 02, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aac, mod: moved decoder command check into loop condition
Avoid while(true) loops, and convert them to a loop with a proper condition.
parent
3f6fcfd3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
aac_plugin.c
src/decoder/aac_plugin.c
+4
-8
mod_plugin.c
src/decoder/mod_plugin.c
+5
-10
No files found.
src/decoder/aac_plugin.c
View file @
5b13f067
...
...
@@ -363,7 +363,7 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
advanceAacBuffer
(
&
b
,
bread
);
while
(
true
)
{
do
{
fillAacBuffer
(
&
b
);
adts_find_frame
(
&
b
);
fillAacBuffer
(
&
b
);
...
...
@@ -414,9 +414,7 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
decoder_data
(
mpd_decoder
,
NULL
,
sampleBuffer
,
sampleBufferLen
,
file_time
,
bitRate
,
NULL
);
if
(
decoder_get_command
(
mpd_decoder
)
==
DECODE_COMMAND_STOP
)
break
;
}
}
while
(
decoder_get_command
(
mpd_decoder
)
==
DECODE_COMMAND_NONE
);
faacDecClose
(
decoder
);
if
(
b
.
buffer
)
...
...
@@ -495,7 +493,7 @@ aac_decode(struct decoder *mpd_decoder, const char *path)
advanceAacBuffer
(
&
b
,
bread
);
while
(
true
)
{
do
{
fillAacBuffer
(
&
b
);
if
(
b
.
bytesIntoBuffer
==
0
)
...
...
@@ -544,9 +542,7 @@ aac_decode(struct decoder *mpd_decoder, const char *path)
decoder_data
(
mpd_decoder
,
NULL
,
sampleBuffer
,
sampleBufferLen
,
file_time
,
bitRate
,
NULL
);
if
(
decoder_get_command
(
mpd_decoder
)
==
DECODE_COMMAND_STOP
)
break
;
}
}
while
(
decoder_get_command
(
mpd_decoder
)
==
DECODE_COMMAND_NONE
);
faacDecClose
(
decoder
);
if
(
b
.
buffer
)
...
...
src/decoder/mod_plugin.c
View file @
5b13f067
...
...
@@ -179,6 +179,7 @@ mod_decode(struct decoder *decoder, const char *path)
float
total_time
=
0
.
0
;
int
ret
;
float
secPerByte
;
enum
decoder_command
cmd
=
DECODE_COMMAND_NONE
;
if
(
!
mod_initMikMod
())
return
false
;
...
...
@@ -199,18 +200,12 @@ mod_decode(struct decoder *decoder, const char *path)
decoder_initialized
(
decoder
,
&
audio_format
,
false
,
0
);
while
(
true
)
{
if
(
decoder_get_command
(
decoder
)
==
DECODE_COMMAND_STOP
)
break
;
if
(
!
Player_Active
())
break
;
while
(
cmd
==
DECODE_COMMAND_NONE
&&
Player_Active
())
{
ret
=
VC_WriteBytes
(
data
->
audio_buffer
,
MIKMOD_FRAME_SIZE
);
total_time
+=
ret
*
secPerByte
;
decoder_data
(
decoder
,
NULL
,
(
char
*
)
data
->
audio_buffer
,
ret
,
total_time
,
0
,
NULL
);
cmd
=
decoder_data
(
decoder
,
NULL
,
data
->
audio_buffer
,
ret
,
total_time
,
0
,
NULL
);
}
mod_close
(
data
);
...
...
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