Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
dca22ab0
Commit
dca22ab0
authored
Jul 17, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/resample: Use av_m/realloc_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ad516dd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
resample.c
libavcodec/resample.c
+3
-3
No files found.
libavcodec/resample.c
View file @
dca22ab0
...
@@ -347,10 +347,10 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
...
@@ -347,10 +347,10 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
/* XXX: move those malloc to resample init code */
/* XXX: move those malloc to resample init code */
for
(
i
=
0
;
i
<
s
->
filter_channels
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
filter_channels
;
i
++
)
{
bufin
[
i
]
=
av_malloc
((
nb_samples
+
s
->
temp_len
)
*
sizeof
(
short
));
bufin
[
i
]
=
av_malloc
_array
((
nb_samples
+
s
->
temp_len
),
sizeof
(
short
));
memcpy
(
bufin
[
i
],
s
->
temp
[
i
],
s
->
temp_len
*
sizeof
(
short
));
memcpy
(
bufin
[
i
],
s
->
temp
[
i
],
s
->
temp_len
*
sizeof
(
short
));
buftmp2
[
i
]
=
bufin
[
i
]
+
s
->
temp_len
;
buftmp2
[
i
]
=
bufin
[
i
]
+
s
->
temp_len
;
bufout
[
i
]
=
av_malloc
(
lenout
*
sizeof
(
short
));
bufout
[
i
]
=
av_malloc
_array
(
lenout
,
sizeof
(
short
));
}
}
if
(
s
->
input_channels
==
2
&&
s
->
output_channels
==
1
)
{
if
(
s
->
input_channels
==
2
&&
s
->
output_channels
==
1
)
{
...
@@ -384,7 +384,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
...
@@ -384,7 +384,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
nb_samples1
=
av_resample
(
s
->
resample_context
,
buftmp3
[
i
],
bufin
[
i
],
nb_samples1
=
av_resample
(
s
->
resample_context
,
buftmp3
[
i
],
bufin
[
i
],
&
consumed
,
nb_samples
,
lenout
,
is_last
);
&
consumed
,
nb_samples
,
lenout
,
is_last
);
s
->
temp_len
=
nb_samples
-
consumed
;
s
->
temp_len
=
nb_samples
-
consumed
;
s
->
temp
[
i
]
=
av_realloc
(
s
->
temp
[
i
],
s
->
temp_len
*
sizeof
(
short
));
s
->
temp
[
i
]
=
av_realloc
_array
(
s
->
temp
[
i
],
s
->
temp_len
,
sizeof
(
short
));
memcpy
(
s
->
temp
[
i
],
bufin
[
i
]
+
consumed
,
s
->
temp_len
*
sizeof
(
short
));
memcpy
(
s
->
temp
[
i
],
bufin
[
i
]
+
consumed
,
s
->
temp_len
*
sizeof
(
short
));
}
}
...
...
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