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
11f2cad1
Commit
11f2cad1
authored
Jun 24, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/filtering_audio: update for avfilter API "cleanup"
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
98b3f17b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
filtering_audio.c
doc/examples/filtering_audio.c
+7
-5
No files found.
doc/examples/filtering_audio.c
View file @
11f2cad1
...
...
@@ -88,7 +88,6 @@ static int init_filters(const char *filters_descr)
AVFilterInOut
*
outputs
=
avfilter_inout_alloc
();
AVFilterInOut
*
inputs
=
avfilter_inout_alloc
();
const
enum
AVSampleFormat
sample_fmts
[]
=
{
AV_SAMPLE_FMT_S16
,
-
1
};
const
int64_t
*
chlayouts
=
avfilter_all_channel_layouts
;
AVABufferSinkParams
*
abuffersink_params
;
const
AVFilterLink
*
outlink
;
AVRational
time_base
=
fmt_ctx
->
streams
[
audio_stream_index
]
->
time_base
;
...
...
@@ -112,7 +111,6 @@ static int init_filters(const char *filters_descr)
/* buffer audio sink: to terminate the filter chain. */
abuffersink_params
=
av_abuffersink_params_alloc
();
abuffersink_params
->
sample_fmts
=
sample_fmts
;
abuffersink_params
->
channel_layouts
=
chlayouts
;
ret
=
avfilter_graph_create_filter
(
&
buffersink_ctx
,
abuffersink
,
"out"
,
NULL
,
abuffersink_params
,
filter_graph
);
av_free
(
abuffersink_params
);
...
...
@@ -211,11 +209,15 @@ int main(int argc, char **argv)
}
/* pull filtered audio from the filtergraph */
while
(
avfilter_poll_frame
(
buffersink_ctx
->
inputs
[
0
]))
{
av_buffersink_get_buffer_ref
(
buffersink_ctx
,
&
samplesref
,
0
);
while
(
1
)
{
ret
=
av_buffersink_get_buffer_ref
(
buffersink_ctx
,
&
samplesref
,
0
);
if
(
ret
==
AVERROR
(
EAGAIN
)
||
ret
==
AVERROR_EOF
)
break
;
if
(
ret
<
0
)
goto
end
;
if
(
samplesref
)
{
print_samplesref
(
samplesref
);
avfilter_unref_buffer
(
samplesref
);
avfilter_unref_buffer
p
(
&
samplesref
);
}
}
}
...
...
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