Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1328d433
Commit
1328d433
authored
Feb 23, 2011
by
Justin Ruggles
Committed by
Ronald S. Bultje
Feb 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmdaudio: remove duplicated code by merging mono and stereo decoding.
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
a58bcb40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
22 deletions
+1
-22
vmdav.c
libavcodec/vmdav.c
+1
-22
No files found.
libavcodec/vmdav.c
View file @
1328d433
...
@@ -475,19 +475,16 @@ static void vmdaudio_decode_audio(VmdAudioContext *s, unsigned char *data,
...
@@ -475,19 +475,16 @@ static void vmdaudio_decode_audio(VmdAudioContext *s, unsigned char *data,
static
int
vmdaudio_loadsound
(
VmdAudioContext
*
s
,
unsigned
char
*
data
,
static
int
vmdaudio_loadsound
(
VmdAudioContext
*
s
,
unsigned
char
*
data
,
const
uint8_t
*
buf
,
int
silence
,
int
data_size
)
const
uint8_t
*
buf
,
int
silence
,
int
data_size
)
{
{
int
bytes_decoded
=
0
;
int
i
;
int
i
;
// if (silence)
// if (silence)
// av_log(s->avctx, AV_LOG_INFO, "silent block!\n");
// av_log(s->avctx, AV_LOG_INFO, "silent block!\n");
if
(
s
->
channels
==
2
)
{
/* stereo handling */
if
(
silence
)
{
if
(
silence
)
{
memset
(
data
,
0
,
data_size
*
2
);
memset
(
data
,
0
,
data_size
*
2
);
}
else
{
}
else
{
if
(
s
->
bits
==
16
)
if
(
s
->
bits
==
16
)
vmdaudio_decode_audio
(
s
,
data
,
buf
,
data_size
,
1
);
vmdaudio_decode_audio
(
s
,
data
,
buf
,
data_size
,
s
->
channels
==
2
);
else
{
else
{
/* copy the data but convert it to signed */
/* copy the data but convert it to signed */
for
(
i
=
0
;
i
<
data_size
;
i
++
){
for
(
i
=
0
;
i
<
data_size
;
i
++
){
...
@@ -496,24 +493,6 @@ static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
...
@@ -496,24 +493,6 @@ static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
}
}
}
}
}
}
}
else
{
bytes_decoded
=
data_size
*
2
;
/* mono handling */
if
(
silence
)
{
memset
(
data
,
0
,
data_size
*
2
);
}
else
{
if
(
s
->
bits
==
16
)
{
vmdaudio_decode_audio
(
s
,
data
,
buf
,
data_size
,
0
);
}
else
{
/* copy the data but convert it to signed */
for
(
i
=
0
;
i
<
data_size
;
i
++
){
*
data
++
=
buf
[
i
]
+
0x80
;
*
data
++
=
buf
[
i
]
+
0x80
;
}
}
}
}
return
data_size
*
2
;
return
data_size
*
2
;
}
}
...
...
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