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
f4e814f7
Commit
f4e814f7
authored
Aug 10, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swresample: check av_opt_set for failure in swr_alloc_set_opts()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c4ac48c5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
+31
-9
swresample.c
libswresample/swresample.c
+31
-9
No files found.
libswresample/swresample.c
View file @
f4e814f7
...
@@ -62,17 +62,39 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
...
@@ -62,17 +62,39 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
s
->
log_level_offset
=
log_offset
;
s
->
log_level_offset
=
log_offset
;
s
->
log_ctx
=
log_ctx
;
s
->
log_ctx
=
log_ctx
;
av_opt_set_int
(
s
,
"ocl"
,
out_ch_layout
,
0
);
if
(
av_opt_set_int
(
s
,
"ocl"
,
out_ch_layout
,
0
)
<
0
)
av_opt_set_int
(
s
,
"osf"
,
out_sample_fmt
,
0
);
goto
fail
;
av_opt_set_int
(
s
,
"osr"
,
out_sample_rate
,
0
);
av_opt_set_int
(
s
,
"icl"
,
in_ch_layout
,
0
);
if
(
av_opt_set_int
(
s
,
"osf"
,
out_sample_fmt
,
0
)
<
0
)
av_opt_set_int
(
s
,
"isf"
,
in_sample_fmt
,
0
);
goto
fail
;
av_opt_set_int
(
s
,
"isr"
,
in_sample_rate
,
0
);
av_opt_set_int
(
s
,
"tsf"
,
AV_SAMPLE_FMT_NONE
,
0
);
if
(
av_opt_set_int
(
s
,
"osr"
,
out_sample_rate
,
0
)
<
0
)
av_opt_set_int
(
s
,
"ich"
,
av_get_channel_layout_nb_channels
(
s
->
in_ch_layout
),
0
);
goto
fail
;
av_opt_set_int
(
s
,
"och"
,
av_get_channel_layout_nb_channels
(
s
->
out_ch_layout
),
0
);
if
(
av_opt_set_int
(
s
,
"icl"
,
in_ch_layout
,
0
)
<
0
)
goto
fail
;
if
(
av_opt_set_int
(
s
,
"isf"
,
in_sample_fmt
,
0
)
<
0
)
goto
fail
;
if
(
av_opt_set_int
(
s
,
"isr"
,
in_sample_rate
,
0
)
<
0
)
goto
fail
;
if
(
av_opt_set_int
(
s
,
"tsf"
,
AV_SAMPLE_FMT_NONE
,
0
)
<
0
)
goto
fail
;
if
(
av_opt_set_int
(
s
,
"ich"
,
av_get_channel_layout_nb_channels
(
s
->
in_ch_layout
),
0
)
<
0
)
goto
fail
;
if
(
av_opt_set_int
(
s
,
"och"
,
av_get_channel_layout_nb_channels
(
s
->
out_ch_layout
),
0
)
<
0
)
goto
fail
;
av_opt_set_int
(
s
,
"uch"
,
0
,
0
);
av_opt_set_int
(
s
,
"uch"
,
0
,
0
);
return
s
;
return
s
;
fail
:
av_log
(
s
,
AV_LOG_ERROR
,
"Failed to set option
\n
"
);
swr_free
(
&
s
);
return
NULL
;
}
}
static
void
set_audiodata_fmt
(
AudioData
*
a
,
enum
AVSampleFormat
fmt
){
static
void
set_audiodata_fmt
(
AudioData
*
a
,
enum
AVSampleFormat
fmt
){
...
...
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