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
6e2473ed
Commit
6e2473ed
authored
Oct 25, 2013
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: parsing helper for unknown channel layouts.
Make ff_parse_channel_layout() accept unknown layouts too.
parent
d300f5f6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
7 deletions
+23
-7
af_aconvert.c
libavfilter/af_aconvert.c
+1
-1
af_pan.c
libavfilter/af_pan.c
+1
-1
asrc_aevalsrc.c
libavfilter/asrc_aevalsrc.c
+1
-1
asrc_anullsrc.c
libavfilter/asrc_anullsrc.c
+1
-1
formats.c
libavfilter/formats.c
+15
-2
internal.h
libavfilter/internal.h
+4
-1
No files found.
libavfilter/af_aconvert.c
View file @
6e2473ed
...
...
@@ -66,7 +66,7 @@ static av_cold int init(AVFilterContext *ctx)
(
ret
=
ff_parse_sample_format
(
&
aconvert
->
out_sample_fmt
,
aconvert
->
format_str
,
ctx
))
<
0
)
return
ret
;
if
(
aconvert
->
channel_layout_str
&&
strcmp
(
aconvert
->
channel_layout_str
,
"auto"
))
return
ff_parse_channel_layout
(
&
aconvert
->
out_chlayout
,
aconvert
->
channel_layout_str
,
ctx
);
return
ff_parse_channel_layout
(
&
aconvert
->
out_chlayout
,
NULL
,
aconvert
->
channel_layout_str
,
ctx
);
return
ret
;
}
...
...
libavfilter/af_pan.c
View file @
6e2473ed
...
...
@@ -116,7 +116,7 @@ static av_cold int init(AVFilterContext *ctx)
if
(
!
args
)
return
AVERROR
(
ENOMEM
);
arg
=
av_strtok
(
args
,
"|"
,
&
tokenizer
);
ret
=
ff_parse_channel_layout
(
&
pan
->
out_channel_layout
,
arg
,
ctx
);
ret
=
ff_parse_channel_layout
(
&
pan
->
out_channel_layout
,
NULL
,
arg
,
ctx
);
if
(
ret
<
0
)
goto
fail
;
pan
->
nb_output_channels
=
av_get_channel_layout_nb_channels
(
pan
->
out_channel_layout
);
...
...
libavfilter/asrc_aevalsrc.c
View file @
6e2473ed
...
...
@@ -109,7 +109,7 @@ static av_cold int init(AVFilterContext *ctx)
if
(
eval
->
chlayout_str
)
{
int
n
;
ret
=
ff_parse_channel_layout
(
&
eval
->
chlayout
,
eval
->
chlayout_str
,
ctx
);
ret
=
ff_parse_channel_layout
(
&
eval
->
chlayout
,
NULL
,
eval
->
chlayout_str
,
ctx
);
if
(
ret
<
0
)
goto
end
;
...
...
libavfilter/asrc_anullsrc.c
View file @
6e2473ed
...
...
@@ -68,7 +68,7 @@ static av_cold int init(AVFilterContext *ctx)
null
->
sample_rate_str
,
ctx
))
<
0
)
return
ret
;
if
((
ret
=
ff_parse_channel_layout
(
&
null
->
channel_layout
,
if
((
ret
=
ff_parse_channel_layout
(
&
null
->
channel_layout
,
NULL
,
null
->
channel_layout_str
,
ctx
))
<
0
)
return
ret
;
...
...
libavfilter/formats.c
View file @
6e2473ed
...
...
@@ -615,10 +615,21 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx)
return
0
;
}
int
ff_parse_channel_layout
(
int64_t
*
ret
,
const
char
*
arg
,
void
*
log_ctx
)
int
ff_parse_channel_layout
(
int64_t
*
ret
,
int
*
nret
,
const
char
*
arg
,
void
*
log_ctx
)
{
char
*
tail
;
int64_t
chlayout
=
av_get_channel_layout
(
arg
);
int64_t
chlayout
,
count
;
if
(
nret
)
{
count
=
strtol
(
arg
,
&
tail
,
10
);
if
(
*
tail
==
'c'
&&
!
tail
[
1
]
&&
count
>
0
&&
count
<
63
)
{
*
nret
=
count
;
*
ret
=
0
;
return
0
;
}
}
chlayout
=
av_get_channel_layout
(
arg
);
if
(
chlayout
==
0
)
{
chlayout
=
strtol
(
arg
,
&
tail
,
10
);
if
(
*
tail
||
chlayout
==
0
)
{
...
...
@@ -627,6 +638,8 @@ int ff_parse_channel_layout(int64_t *ret, const char *arg, void *log_ctx)
}
}
*
ret
=
chlayout
;
if
(
nret
)
*
nret
=
av_get_channel_layout_nb_channels
(
chlayout
);
return
0
;
}
...
...
libavfilter/internal.h
View file @
6e2473ed
...
...
@@ -207,11 +207,14 @@ int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);
* Parse a channel layout or a corresponding integer representation.
*
* @param ret 64bit integer pointer to where the value should be written.
* @param nret integer pointer to the number of channels;
* if not NULL, then unknown channel layouts are accepted
* @param arg string to parse
* @param log_ctx log context
* @return >= 0 in case of success, a negative AVERROR code on error
*/
int
ff_parse_channel_layout
(
int64_t
*
ret
,
const
char
*
arg
,
void
*
log_ctx
);
int
ff_parse_channel_layout
(
int64_t
*
ret
,
int
*
nret
,
const
char
*
arg
,
void
*
log_ctx
);
void
ff_update_link_current_pts
(
AVFilterLink
*
link
,
int64_t
pts
);
...
...
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