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
784675ca
Commit
784675ca
authored
Jun 24, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sink_buffer: make opaque argument optional.
parent
a2bd8a93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
sink_buffer.c
libavfilter/sink_buffer.c
+20
-16
No files found.
libavfilter/sink_buffer.c
View file @
784675ca
...
...
@@ -231,24 +231,25 @@ static void filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
static
av_cold
int
asink_init
(
AVFilterContext
*
ctx
,
const
char
*
args
,
void
*
opaque
)
{
BufferSinkContext
*
buf
=
ctx
->
priv
;
AVABufferSinkParams
*
params
;
AVABufferSinkParams
*
params
=
opaque
;
if
(
!
opaque
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"No opaque field provided, an AVABufferSinkParams struct is required
\n
"
);
return
AVERROR
(
EINVAL
);
}
else
params
=
(
AVABufferSinkParams
*
)
opaque
;
buf
->
sample_fmts
=
ff_copy_int_list
(
params
->
sample_fmts
);
buf
->
channel_layouts
=
ff_copy_int64_list
(
params
->
channel_layouts
);
if
(
!
buf
->
sample_fmts
||
!
buf
->
channel_layouts
)
{
av_freep
(
&
buf
->
sample_fmts
);
av_freep
(
&
buf
->
channel_layouts
);
return
AVERROR
(
ENOMEM
);
if
(
params
&&
params
->
sample_fmts
)
{
buf
->
sample_fmts
=
ff_copy_int_list
(
params
->
sample_fmts
);
if
(
!
buf
->
sample_fmts
)
goto
fail_enomem
;
}
if
(
params
&&
params
->
channel_layouts
)
{
buf
->
channel_layouts
=
ff_copy_int64_list
(
params
->
channel_layouts
);
if
(
!
buf
->
channel_layouts
)
goto
fail_enomem
;
}
if
(
!
common_init
(
ctx
))
return
0
;
return
common_init
(
ctx
);
fail_enomem:
av_freep
(
&
buf
->
sample_fmts
);
av_freep
(
&
buf
->
channel_layouts
);
return
AVERROR
(
ENOMEM
);
}
static
av_cold
void
asink_uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -266,14 +267,17 @@ static int asink_query_formats(AVFilterContext *ctx)
AVFilterFormats
*
formats
=
NULL
;
AVFilterChannelLayouts
*
layouts
=
NULL
;
if
(
buf
->
sample_fmts
)
{
if
(
!
(
formats
=
ff_make_format_list
(
buf
->
sample_fmts
)))
return
AVERROR
(
ENOMEM
);
ff_set_common_formats
(
ctx
,
formats
);
}
if
(
buf
->
channel_layouts
)
{
if
(
!
(
layouts
=
avfilter_make_format64_list
(
buf
->
channel_layouts
)))
return
AVERROR
(
ENOMEM
);
ff_set_common_channel_layouts
(
ctx
,
layouts
);
ff_set_common_samplerates
(
ctx
,
ff_all_samplerates
());
}
return
0
;
}
...
...
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