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
6078bd80
Commit
6078bd80
authored
Oct 26, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/showspectrum: fix unaligned rdft data.
parent
2ef26b5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+8
-4
No files found.
libavfilter/avf_showspectrum.c
View file @
6078bd80
...
@@ -132,16 +132,20 @@ static int config_output(AVFilterLink *outlink)
...
@@ -132,16 +132,20 @@ static int config_output(AVFilterLink *outlink)
/* (re-)configuration if the video output changed (or first init) */
/* (re-)configuration if the video output changed (or first init) */
if
(
rdft_bits
!=
showspectrum
->
rdft_bits
)
{
if
(
rdft_bits
!=
showspectrum
->
rdft_bits
)
{
size_t
rdft_size
;
AVFilterBufferRef
*
outpicref
;
AVFilterBufferRef
*
outpicref
;
av_rdft_end
(
showspectrum
->
rdft
);
av_rdft_end
(
showspectrum
->
rdft
);
showspectrum
->
rdft
=
av_rdft_init
(
rdft_bits
,
DFT_R2C
);
showspectrum
->
rdft
=
av_rdft_init
(
rdft_bits
,
DFT_R2C
);
showspectrum
->
rdft_bits
=
rdft_bits
;
showspectrum
->
rdft_bits
=
rdft_bits
;
/* RDFT buffers: x2 for each (display) channel buffer */
/* RDFT buffers: x2 for each (display) channel buffer.
showspectrum
->
rdft_data
=
* Note: we use free and malloc instead of a realloc-like function to
av_realloc_f
(
showspectrum
->
rdft_data
,
2
*
win_size
,
* make sure the buffer is aligned in memory for the FFT functions. */
sizeof
(
*
showspectrum
->
rdft_data
));
av_freep
(
&
showspectrum
->
rdft_data
);
if
(
av_size_mult
(
sizeof
(
*
showspectrum
->
rdft_data
),
2
*
win_size
,
&
rdft_size
)
<
0
)
return
AVERROR
(
EINVAL
);
showspectrum
->
rdft_data
=
av_malloc
(
rdft_size
);
if
(
!
showspectrum
->
rdft_data
)
if
(
!
showspectrum
->
rdft_data
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
showspectrum
->
filled
=
0
;
showspectrum
->
filled
=
0
;
...
...
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