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
0109a09d
Commit
0109a09d
authored
Mar 28, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil: use align == 0 for default alignment in audio sample buffer functions
parent
18ed3788
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
avutil.h
libavutil/avutil.h
+1
-1
samplefmt.c
libavutil/samplefmt.c
+4
-0
samplefmt.h
libavutil/samplefmt.h
+3
-2
No files found.
libavutil/avutil.h
View file @
0109a09d
...
...
@@ -153,7 +153,7 @@
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 27
#define LIBAVUTIL_VERSION_MICRO
1
#define LIBAVUTIL_VERSION_MICRO
2
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
...
...
libavutil/samplefmt.c
View file @
0109a09d
...
...
@@ -123,6 +123,10 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
if
(
!
sample_size
||
nb_samples
<=
0
||
nb_channels
<=
0
)
return
AVERROR
(
EINVAL
);
/* auto-select alignment if not specified */
if
(
!
align
)
align
=
32
;
/* check for integer overflow */
if
(
nb_channels
>
INT_MAX
/
align
||
(
int64_t
)
nb_channels
*
nb_samples
>
(
INT_MAX
-
(
align
*
nb_channels
))
/
sample_size
)
...
...
libavutil/samplefmt.h
View file @
0109a09d
...
...
@@ -121,6 +121,7 @@ int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
* @param nb_channels the number of channels
* @param nb_samples the number of samples in a single channel
* @param sample_fmt the sample format
* @param align buffer size alignment (0 = default, 1 = no alignment)
* @return required buffer size, or negative error code on failure
*/
int
av_samples_get_buffer_size
(
int
*
linesize
,
int
nb_channels
,
int
nb_samples
,
...
...
@@ -144,7 +145,7 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
* @param nb_channels the number of channels
* @param nb_samples the number of samples in a single channel
* @param sample_fmt the sample format
* @param align buffer size alignment (
1 = no alignment required
)
* @param align buffer size alignment (
0 = default, 1 = no alignment
)
* @return 0 on success or a negative error code on failure
*/
int
av_samples_fill_arrays
(
uint8_t
**
audio_data
,
int
*
linesize
,
uint8_t
*
buf
,
...
...
@@ -160,7 +161,7 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, uint8_t *buf,
* @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
)
* @param align buffer size alignment (
0 = default, 1 = no alignment
)
* @return 0 on success or a negative error code on failure
* @see av_samples_fill_arrays()
*/
...
...
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