Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
406b257d
Commit
406b257d
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
audioconvert: add a function for getting channel's index in layout
parent
3596de55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavutil/audioconvert.c
+10
-0
10 additions, 0 deletions
libavutil/audioconvert.c
libavutil/audioconvert.h
+12
-0
12 additions, 0 deletions
libavutil/audioconvert.h
with
22 additions
and
0 deletions
libavutil/audioconvert.c
+
10
−
0
View file @
406b257d
...
...
@@ -192,3 +192,13 @@ uint64_t av_get_default_channel_layout(int nb_channels)
default:
return
0
;
}
}
int
av_get_channel_layout_channel_index
(
uint64_t
channel_layout
,
uint64_t
channel
)
{
if
(
!
(
channel_layout
&
channel
)
||
av_get_channel_layout_nb_channels
(
channel
)
!=
1
)
return
AVERROR
(
EINVAL
);
channel_layout
&=
channel
-
1
;
return
av_get_channel_layout_nb_channels
(
channel_layout
);
}
This diff is collapsed.
Click to expand it.
libavutil/audioconvert.h
+
12
−
0
View file @
406b257d
...
...
@@ -143,6 +143,18 @@ int av_get_channel_layout_nb_channels(uint64_t channel_layout);
*/
uint64_t
av_get_default_channel_layout
(
int
nb_channels
);
/**
* Get the index of a channel in channel_layout.
*
* @param channel a channel layout describing exactly one channel which must be
* present in channel_layout.
*
* @return index of channel in channel_layout on success, a negative AVERROR
* on error.
*/
int
av_get_channel_layout_channel_index
(
uint64_t
channel_layout
,
uint64_t
channel
);
/**
* @}
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment