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
fecdc76a
Commit
fecdc76a
authored
May 06, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: fix cpy() after the len was changed to be in samples.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
715c8a5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
audioconvert.c
libswresample/audioconvert.c
+18
-3
No files found.
libswresample/audioconvert.c
View file @
fecdc76a
...
@@ -107,9 +107,18 @@ static conv_func_type * const fmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB*AV_SAM
...
@@ -107,9 +107,18 @@ static conv_func_type * const fmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB*AV_SAM
FMT_PAIR_FUNC
(
AV_SAMPLE_FMT_DBL
,
AV_SAMPLE_FMT_DBL
),
FMT_PAIR_FUNC
(
AV_SAMPLE_FMT_DBL
,
AV_SAMPLE_FMT_DBL
),
};
};
static
void
cpy
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
){
static
void
cpy
1
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
){
memcpy
(
*
dst
,
*
src
,
len
);
memcpy
(
*
dst
,
*
src
,
len
);
}
}
static
void
cpy2
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
){
memcpy
(
*
dst
,
*
src
,
2
*
len
);
}
static
void
cpy4
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
){
memcpy
(
*
dst
,
*
src
,
4
*
len
);
}
static
void
cpy8
(
uint8_t
**
dst
,
const
uint8_t
**
src
,
int
len
){
memcpy
(
*
dst
,
*
src
,
8
*
len
);
}
AudioConvert
*
swri_audio_convert_alloc
(
enum
AVSampleFormat
out_fmt
,
AudioConvert
*
swri_audio_convert_alloc
(
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
,
enum
AVSampleFormat
in_fmt
,
...
@@ -136,8 +145,14 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt,
...
@@ -136,8 +145,14 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt,
if
(
in_fmt
==
AV_SAMPLE_FMT_U8
)
if
(
in_fmt
==
AV_SAMPLE_FMT_U8
)
memset
(
ctx
->
silence
,
0x80
,
sizeof
(
ctx
->
silence
));
memset
(
ctx
->
silence
,
0x80
,
sizeof
(
ctx
->
silence
));
if
(
out_fmt
==
in_fmt
&&
!
ch_map
)
if
(
out_fmt
==
in_fmt
&&
!
ch_map
)
{
ctx
->
simd_f
=
cpy
;
switch
(
av_get_bytes_per_sample
(
in_fmt
)){
case
1
:
ctx
->
simd_f
=
cpy1
;
break
;
case
2
:
ctx
->
simd_f
=
cpy2
;
break
;
case
4
:
ctx
->
simd_f
=
cpy4
;
break
;
case
8
:
ctx
->
simd_f
=
cpy8
;
break
;
}
}
if
(
HAVE_YASM
&&
HAVE_MMX
)
swri_audio_convert_init_x86
(
ctx
,
out_fmt
,
in_fmt
,
channels
);
if
(
HAVE_YASM
&&
HAVE_MMX
)
swri_audio_convert_init_x86
(
ctx
,
out_fmt
,
in_fmt
,
channels
);
...
...
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