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
645c61fb
Commit
645c61fb
authored
Nov 16, 2011
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: rename swr_alloc2() to swr_alloc_set_opts().
parent
c4deb90c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
20 deletions
+23
-20
ffmpeg.c
ffmpeg.c
+5
-5
ffplay.c
ffplay.c
+4
-3
swresample.c
libswresample/swresample.c
+4
-3
swresample.h
libswresample/swresample.h
+4
-3
swresample_test.c
libswresample/swresample_test.c
+6
-6
No files found.
ffmpeg.c
View file @
645c61fb
...
...
@@ -891,7 +891,7 @@ need_realloc:
//ost->swr = NULL;
ost
->
audio_resample
=
0
;
}
else
{
ost
->
swr
=
swr_alloc
2
(
ost
->
swr
,
ost
->
swr
=
swr_alloc
_set_opts
(
ost
->
swr
,
enc
->
channel_layout
,
enc
->
sample_fmt
,
enc
->
sample_rate
,
dec
->
channel_layout
,
dec
->
sample_fmt
,
dec
->
sample_rate
,
ost
->
audio_channels_mapped
?
ost
->
audio_channels_map
:
NULL
,
...
...
ffplay.c
View file @
645c61fb
...
...
@@ -2076,7 +2076,8 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
if
(
dec
->
sample_fmt
!=
is
->
audio_src_fmt
||
dec_channel_layout
!=
is
->
audio_src_channel_layout
||
dec
->
sample_rate
!=
is
->
audio_src_freq
)
{
if
(
is
->
swr_ctx
)
swr_free
(
&
is
->
swr_ctx
);
is
->
swr_ctx
=
swr_alloc2
(
NULL
,
is
->
audio_tgt_channel_layout
,
is
->
audio_tgt_fmt
,
is
->
audio_tgt_freq
,
is
->
swr_ctx
=
swr_alloc_set_opts
(
NULL
,
is
->
audio_tgt_channel_layout
,
is
->
audio_tgt_fmt
,
is
->
audio_tgt_freq
,
dec_channel_layout
,
dec
->
sample_fmt
,
dec
->
sample_rate
,
NULL
,
0
,
NULL
);
if
(
!
is
->
swr_ctx
||
swr_init
(
is
->
swr_ctx
)
<
0
)
{
...
...
libswresample/swresample.c
View file @
645c61fb
...
...
@@ -82,7 +82,8 @@ SwrContext *swr_alloc(void){
return
s
;
}
SwrContext
*
swr_alloc2
(
struct
SwrContext
*
s
,
int64_t
out_ch_layout
,
enum
AVSampleFormat
out_sample_fmt
,
int
out_sample_rate
,
SwrContext
*
swr_alloc_set_opts
(
struct
SwrContext
*
s
,
int64_t
out_ch_layout
,
enum
AVSampleFormat
out_sample_fmt
,
int
out_sample_rate
,
int64_t
in_ch_layout
,
enum
AVSampleFormat
in_sample_fmt
,
int
in_sample_rate
,
const
int
*
channel_map
,
int
log_offset
,
void
*
log_ctx
){
if
(
!
s
)
s
=
swr_alloc
();
...
...
libswresample/swresample.h
View file @
645c61fb
...
...
@@ -55,7 +55,8 @@ int swr_init(struct SwrContext *s);
* @see swr_init(),swr_free()
* @return NULL on error
*/
struct
SwrContext
*
swr_alloc2
(
struct
SwrContext
*
s
,
int64_t
out_ch_layout
,
enum
AVSampleFormat
out_sample_fmt
,
int
out_sample_rate
,
struct
SwrContext
*
swr_alloc_set_opts
(
struct
SwrContext
*
s
,
int64_t
out_ch_layout
,
enum
AVSampleFormat
out_sample_fmt
,
int
out_sample_rate
,
int64_t
in_ch_layout
,
enum
AVSampleFormat
in_sample_fmt
,
int
in_sample_rate
,
const
int
*
channel_map
,
int
log_offset
,
void
*
log_ctx
);
...
...
libswresample/swresample_test.c
View file @
645c61fb
...
...
@@ -130,10 +130,10 @@ int main(int argc, char **argv){
in_ch_count
,
out_ch_count
,
in_sample_rate
,
out_sample_rate
,
av_get_sample_fmt_name
(
in_sample_fmt
),
av_get_sample_fmt_name
(
out_sample_fmt
));
forw_ctx
=
swr_alloc
2
(
forw_ctx
,
out_ch_layout
,
out_sample_fmt
+
planar_out
,
out_sample_rate
,
forw_ctx
=
swr_alloc
_set_opts
(
forw_ctx
,
out_ch_layout
,
out_sample_fmt
+
planar_out
,
out_sample_rate
,
in_ch_layout
,
in_sample_fmt
+
planar_in
,
in_sample_rate
,
NULL
,
0
,
0
);
backw_ctx
=
swr_alloc
2
(
backw_ctx
,
in_ch_layout
,
in_sample_fmt
,
in_sample_rate
,
backw_ctx
=
swr_alloc
_set_opts
(
backw_ctx
,
in_ch_layout
,
in_sample_fmt
,
in_sample_rate
,
out_ch_layout
,
out_sample_fmt
+
planar_out
,
out_sample_rate
,
NULL
,
0
,
0
);
if
(
swr_init
(
forw_ctx
)
<
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