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
4c066249
Commit
4c066249
authored
Aug 26, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed local variable "eof" because it is unused
"break" is so much easier than "eof=1; continue;", when "!eof" is the loop condition.
parent
ee3bbb50
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
19 deletions
+9
-19
aac_plugin.c
src/inputPlugins/aac_plugin.c
+4
-9
mp4_plugin.c
src/inputPlugins/mp4_plugin.c
+5
-10
No files found.
src/inputPlugins/aac_plugin.c
View file @
4c066249
...
@@ -289,7 +289,6 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
...
@@ -289,7 +289,6 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
AudioFormat
audio_format
;
AudioFormat
audio_format
;
uint32_t
sampleRate
;
uint32_t
sampleRate
;
unsigned
char
channels
;
unsigned
char
channels
;
int
eof
=
0
;
unsigned
int
sampleCount
;
unsigned
int
sampleCount
;
char
*
sampleBuffer
;
char
*
sampleBuffer
;
size_t
sampleBufferLen
;
size_t
sampleBufferLen
;
...
@@ -342,13 +341,12 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
...
@@ -342,13 +341,12 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
advanceAacBuffer
(
&
b
,
bread
);
advanceAacBuffer
(
&
b
,
bread
);
while
(
!
eof
)
{
while
(
1
)
{
fillAacBuffer
(
&
b
);
fillAacBuffer
(
&
b
);
if
(
b
.
bytesIntoBuffer
==
0
)
{
if
(
b
.
bytesIntoBuffer
==
0
)
eof
=
1
;
break
;
break
;
}
#ifdef HAVE_FAAD_BUFLEN_FUNCS
#ifdef HAVE_FAAD_BUFLEN_FUNCS
sampleBuffer
=
faacDecDecode
(
decoder
,
&
frameInfo
,
b
.
buffer
,
sampleBuffer
=
faacDecDecode
(
decoder
,
&
frameInfo
,
b
.
buffer
,
b
.
bytesIntoBuffer
);
b
.
bytesIntoBuffer
);
...
@@ -360,7 +358,6 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
...
@@ -360,7 +358,6 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
ERROR
(
"error decoding AAC file: %s
\n
"
,
path
);
ERROR
(
"error decoding AAC file: %s
\n
"
,
path
);
ERROR
(
"faad2 error: %s
\n
"
,
ERROR
(
"faad2 error: %s
\n
"
,
faacDecGetErrorMessage
(
frameInfo
.
error
));
faacDecGetErrorMessage
(
frameInfo
.
error
));
eof
=
1
;
break
;
break
;
}
}
#ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE
#ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE
...
@@ -395,11 +392,9 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
...
@@ -395,11 +392,9 @@ static int aac_decode(struct decoder * mpd_decoder, char *path)
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
{
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
{
dc
.
seekError
=
1
;
dc
.
seekError
=
1
;
dc_command_finished
();
dc_command_finished
();
}
else
if
(
dc
.
command
==
DECODE_COMMAND_STOP
)
{
}
else
if
(
dc
.
command
==
DECODE_COMMAND_STOP
)
eof
=
1
;
break
;
break
;
}
}
}
decoder_flush
(
mpd_decoder
);
decoder_flush
(
mpd_decoder
);
...
...
src/inputPlugins/mp4_plugin.c
View file @
4c066249
...
@@ -95,7 +95,6 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
...
@@ -95,7 +95,6 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
unsigned
char
channels
;
unsigned
char
channels
;
long
sampleId
;
long
sampleId
;
long
numSamples
;
long
numSamples
;
int
eof
=
0
;
long
dur
;
long
dur
;
unsigned
int
sampleCount
;
unsigned
int
sampleCount
;
char
*
sampleBuffer
;
char
*
sampleBuffer
;
...
@@ -178,7 +177,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
...
@@ -178,7 +177,7 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
seekTable
=
xmalloc
(
sizeof
(
float
)
*
numSamples
);
seekTable
=
xmalloc
(
sizeof
(
float
)
*
numSamples
);
for
(
sampleId
=
0
;
sampleId
<
numSamples
&&
!
eof
;
sampleId
++
)
{
for
(
sampleId
=
0
;
sampleId
<
numSamples
;
sampleId
++
)
{
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
seeking
=
1
;
seeking
=
1
;
...
@@ -221,10 +220,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
...
@@ -221,10 +220,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
continue
;
continue
;
if
(
mp4ff_read_sample
(
mp4fh
,
track
,
sampleId
,
&
mp4Buffer
,
if
(
mp4ff_read_sample
(
mp4fh
,
track
,
sampleId
,
&
mp4Buffer
,
&
mp4BufferSize
)
==
0
)
{
&
mp4BufferSize
)
==
0
)
eof
=
1
;
break
;
continue
;
}
#ifdef HAVE_FAAD_BUFLEN_FUNCS
#ifdef HAVE_FAAD_BUFLEN_FUNCS
sampleBuffer
=
faacDecDecode
(
decoder
,
&
frameInfo
,
mp4Buffer
,
sampleBuffer
=
faacDecDecode
(
decoder
,
&
frameInfo
,
mp4Buffer
,
mp4BufferSize
);
mp4BufferSize
);
...
@@ -237,7 +235,6 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
...
@@ -237,7 +235,6 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
if
(
frameInfo
.
error
>
0
)
{
if
(
frameInfo
.
error
>
0
)
{
ERROR
(
"faad2 error: %s
\n
"
,
ERROR
(
"faad2 error: %s
\n
"
,
faacDecGetErrorMessage
(
frameInfo
.
error
));
faacDecGetErrorMessage
(
frameInfo
.
error
));
eof
=
1
;
break
;
break
;
}
}
...
@@ -273,11 +270,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
...
@@ -273,11 +270,9 @@ static int mp4_decode(struct decoder * mpd_decoder, InputStream * inStream)
decoder_data
(
mpd_decoder
,
inStream
,
1
,
sampleBuffer
,
decoder_data
(
mpd_decoder
,
inStream
,
1
,
sampleBuffer
,
sampleBufferLen
,
file_time
,
sampleBufferLen
,
file_time
,
bitRate
,
NULL
);
bitRate
,
NULL
);
if
(
dc
.
command
==
DECODE_COMMAND_STOP
)
{
if
(
dc
.
command
==
DECODE_COMMAND_STOP
)
eof
=
1
;
break
;
break
;
}
}
}
free
(
seekTable
);
free
(
seekTable
);
faacDecClose
(
decoder
);
faacDecClose
(
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