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
bd5080b1
Commit
bd5080b1
authored
Feb 15, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_pan: comment a tricky piece of code.
parent
cba4e2cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
af_pan.c
libavfilter/af_pan.c
+4
-0
No files found.
libavfilter/af_pan.c
View file @
bd5080b1
...
@@ -64,14 +64,17 @@ static int parse_channel_name(char **arg, int *rchannel, int *rnamed)
...
@@ -64,14 +64,17 @@ static int parse_channel_name(char **arg, int *rchannel, int *rnamed)
int
len
,
i
,
channel_id
=
0
;
int
len
,
i
,
channel_id
=
0
;
int64_t
layout
,
layout0
;
int64_t
layout
,
layout0
;
/* try to parse a channel name, e.g. "FL" */
if
(
sscanf
(
*
arg
,
" %7[A-Z] %n"
,
buf
,
&
len
))
{
if
(
sscanf
(
*
arg
,
" %7[A-Z] %n"
,
buf
,
&
len
))
{
layout0
=
layout
=
av_get_channel_layout
(
buf
);
layout0
=
layout
=
av_get_channel_layout
(
buf
);
/* channel_id <- first set bit in layout */
for
(
i
=
32
;
i
>
0
;
i
>>=
1
)
{
for
(
i
=
32
;
i
>
0
;
i
>>=
1
)
{
if
(
layout
>=
(
int64_t
)
1
<<
i
)
{
if
(
layout
>=
(
int64_t
)
1
<<
i
)
{
channel_id
+=
i
;
channel_id
+=
i
;
layout
>>=
i
;
layout
>>=
i
;
}
}
}
}
/* reject layouts that are not a single channel */
if
(
channel_id
>=
MAX_CHANNELS
||
layout0
!=
(
int64_t
)
1
<<
channel_id
)
if
(
channel_id
>=
MAX_CHANNELS
||
layout0
!=
(
int64_t
)
1
<<
channel_id
)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
*
rchannel
=
channel_id
;
*
rchannel
=
channel_id
;
...
@@ -79,6 +82,7 @@ static int parse_channel_name(char **arg, int *rchannel, int *rnamed)
...
@@ -79,6 +82,7 @@ static int parse_channel_name(char **arg, int *rchannel, int *rnamed)
*
arg
+=
len
;
*
arg
+=
len
;
return
0
;
return
0
;
}
}
/* try to parse a channel number, e.g. "c2" */
if
(
sscanf
(
*
arg
,
" c%d %n"
,
&
channel_id
,
&
len
)
&&
if
(
sscanf
(
*
arg
,
" c%d %n"
,
&
channel_id
,
&
len
)
&&
channel_id
>=
0
&&
channel_id
<
MAX_CHANNELS
)
{
channel_id
>=
0
&&
channel_id
<
MAX_CHANNELS
)
{
*
rchannel
=
channel_id
;
*
rchannel
=
channel_id
;
...
...
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