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
18ed3788
Commit
18ed3788
authored
Mar 28, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil: allow NULL linesize in av_samples_fill_arrays() and av_samples_alloc()
parent
b6c4518a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
samplefmt.c
libavutil/samplefmt.c
+6
-3
samplefmt.h
libavutil/samplefmt.h
+2
-2
No files found.
libavutil/samplefmt.c
View file @
18ed3788
...
...
@@ -140,17 +140,20 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
uint8_t
*
buf
,
int
nb_channels
,
int
nb_samples
,
enum
AVSampleFormat
sample_fmt
,
int
align
)
{
int
ch
,
planar
,
buf_size
;
int
ch
,
planar
,
buf_size
,
line_size
;
planar
=
av_sample_fmt_is_planar
(
sample_fmt
);
buf_size
=
av_samples_get_buffer_size
(
line
size
,
nb_channels
,
nb_samples
,
buf_size
=
av_samples_get_buffer_size
(
&
line_
size
,
nb_channels
,
nb_samples
,
sample_fmt
,
align
);
if
(
buf_size
<
0
)
return
buf_size
;
audio_data
[
0
]
=
buf
;
for
(
ch
=
1
;
planar
&&
ch
<
nb_channels
;
ch
++
)
audio_data
[
ch
]
=
audio_data
[
ch
-
1
]
+
*
linesize
;
audio_data
[
ch
]
=
audio_data
[
ch
-
1
]
+
line_size
;
if
(
linesize
)
*
linesize
=
line_size
;
return
0
;
}
...
...
libavutil/samplefmt.h
View file @
18ed3788
...
...
@@ -139,7 +139,7 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
* for packed layout.
*
* @param[out] audio_data array to be filled with the pointer for each channel
* @param[out] linesize calculated linesize
* @param[out] linesize calculated linesize
, may be NULL
* @param buf the pointer to a buffer containing the samples
* @param nb_channels the number of channels
* @param nb_samples the number of samples in a single channel
...
...
@@ -157,7 +157,7 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, uint8_t *buf,
* The allocated samples buffer can be freed by using av_freep(&audio_data[0])
*
* @param[out] audio_data array to be filled with the pointer for each channel
* @param[out] linesize aligned size for audio buffer(s)
* @param[out] linesize aligned size for audio buffer(s)
, may be NULL
* @param nb_channels number of audio channels
* @param nb_samples number of samples per channel
* @param align buffer size alignment (1 = no alignment required)
...
...
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