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
5cc51a58
Commit
5cc51a58
authored
Mar 22, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil: Add av_get_default_channel_layout()
Also, use the new function in the AC-3 encoder.
parent
0becb078
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
2 deletions
+25
-2
APIchanges
doc/APIchanges
+3
-0
ac3enc.c
libavcodec/ac3enc.c
+1
-1
audioconvert.c
libavutil/audioconvert.c
+15
-0
audioconvert.h
libavutil/audioconvert.h
+5
-0
avutil.h
libavutil/avutil.h
+1
-1
No files found.
doc/APIchanges
View file @
5cc51a58
...
...
@@ -12,6 +12,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2012-xx-xx - xxxxxxx - lavu 51.26.0 - audioconvert.h
Add av_get_default_channel_layout()
2012-03-06 - 4d851f8 - lavu 51.25.0 - cpu.h
Add av_set_cpu_flags_mask().
...
...
libavcodec/ac3enc.c
View file @
5cc51a58
...
...
@@ -2074,7 +2074,7 @@ static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
return
AVERROR
(
EINVAL
);
ch_layout
=
*
channel_layout
;
if
(
!
ch_layout
)
ch_layout
=
av
codec_guess_channel_layout
(
channels
,
CODEC_ID_AC3
,
NULL
);
ch_layout
=
av
_get_default_channel_layout
(
channels
);
s
->
lfe_on
=
!!
(
ch_layout
&
AV_CH_LOW_FREQUENCY
);
s
->
channels
=
channels
;
...
...
libavutil/audioconvert.c
View file @
5cc51a58
...
...
@@ -153,3 +153,18 @@ int av_get_channel_layout_nb_channels(uint64_t channel_layout)
x
&=
x
-
1
;
// unset lowest set bit
return
count
;
}
uint64_t
av_get_default_channel_layout
(
int
nb_channels
)
{
switch
(
nb_channels
)
{
case
1
:
return
AV_CH_LAYOUT_MONO
;
case
2
:
return
AV_CH_LAYOUT_STEREO
;
case
3
:
return
AV_CH_LAYOUT_SURROUND
;
case
4
:
return
AV_CH_LAYOUT_QUAD
;
case
5
:
return
AV_CH_LAYOUT_5POINT0
;
case
6
:
return
AV_CH_LAYOUT_5POINT1
;
case
7
:
return
AV_CH_LAYOUT_6POINT1
;
case
8
:
return
AV_CH_LAYOUT_7POINT1
;
default:
return
0
;
}
}
libavutil/audioconvert.h
View file @
5cc51a58
...
...
@@ -124,6 +124,11 @@ void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint
*/
int
av_get_channel_layout_nb_channels
(
uint64_t
channel_layout
);
/**
* Return default channel layout for a given number of channels.
*/
uint64_t
av_get_default_channel_layout
(
int
nb_channels
);
/**
* @}
*/
...
...
libavutil/avutil.h
View file @
5cc51a58
...
...
@@ -152,7 +152,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 2
5
#define LIBAVUTIL_VERSION_MINOR 2
6
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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