Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
81a65b82
Commit
81a65b82
authored
Nov 29, 2011
by
Clément Bœsch
Committed by
Clément Bœsch
Nov 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: handle correctly muted channel with u8 sample fmt.
parent
9cdf048a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
audioconvert.c
libswresample/audioconvert.c
+5
-3
No files found.
libswresample/audioconvert.c
View file @
81a65b82
...
@@ -38,6 +38,7 @@ struct AudioConvert {
...
@@ -38,6 +38,7 @@ struct AudioConvert {
int
channels
;
int
channels
;
conv_func_type
*
conv_f
;
conv_func_type
*
conv_f
;
const
int
*
ch_map
;
const
int
*
ch_map
;
uint8_t
silence
[
8
];
///< silence input sample
};
};
#define CONV_FUNC_NAME(dst_fmt, src_fmt) conv_ ## src_fmt ## _to_ ## dst_fmt
#define CONV_FUNC_NAME(dst_fmt, src_fmt) conv_ ## src_fmt ## _to_ ## dst_fmt
...
@@ -118,12 +119,14 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt,
...
@@ -118,12 +119,14 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt,
if
(
!
f
)
if
(
!
f
)
return
NULL
;
return
NULL
;
ctx
=
av_malloc
(
sizeof
(
*
ctx
));
ctx
=
av_malloc
z
(
sizeof
(
*
ctx
));
if
(
!
ctx
)
if
(
!
ctx
)
return
NULL
;
return
NULL
;
ctx
->
channels
=
channels
;
ctx
->
channels
=
channels
;
ctx
->
conv_f
=
f
;
ctx
->
conv_f
=
f
;
ctx
->
ch_map
=
ch_map
;
ctx
->
ch_map
=
ch_map
;
if
(
in_fmt
==
AV_SAMPLE_FMT_U8
)
memset
(
ctx
->
silence
,
0x80
,
sizeof
(
ctx
->
silence
));
return
ctx
;
return
ctx
;
}
}
...
@@ -135,7 +138,6 @@ void swri_audio_convert_free(AudioConvert **ctx)
...
@@ -135,7 +138,6 @@ void swri_audio_convert_free(AudioConvert **ctx)
int
swri_audio_convert
(
AudioConvert
*
ctx
,
AudioData
*
out
,
AudioData
*
in
,
int
len
)
int
swri_audio_convert
(
AudioConvert
*
ctx
,
AudioData
*
out
,
AudioData
*
in
,
int
len
)
{
{
int
ch
;
int
ch
;
const
uint8_t
null_input
[
8
]
=
{
0
};
av_assert0
(
ctx
->
channels
==
out
->
ch_count
);
av_assert0
(
ctx
->
channels
==
out
->
ch_count
);
...
@@ -145,7 +147,7 @@ int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len
...
@@ -145,7 +147,7 @@ int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len
const
int
ich
=
ctx
->
ch_map
?
ctx
->
ch_map
[
ch
]
:
ch
;
const
int
ich
=
ctx
->
ch_map
?
ctx
->
ch_map
[
ch
]
:
ch
;
const
int
is
=
ich
<
0
?
0
:
(
in
->
planar
?
1
:
in
->
ch_count
)
*
in
->
bps
;
const
int
is
=
ich
<
0
?
0
:
(
in
->
planar
?
1
:
in
->
ch_count
)
*
in
->
bps
;
const
int
os
=
(
out
->
planar
?
1
:
out
->
ch_count
)
*
out
->
bps
;
const
int
os
=
(
out
->
planar
?
1
:
out
->
ch_count
)
*
out
->
bps
;
const
uint8_t
*
pi
=
ich
<
0
?
null_input
:
in
->
ch
[
ich
];
const
uint8_t
*
pi
=
ich
<
0
?
ctx
->
silence
:
in
->
ch
[
ich
];
uint8_t
*
po
=
out
->
ch
[
ch
];
uint8_t
*
po
=
out
->
ch
[
ch
];
uint8_t
*
end
=
po
+
os
*
len
;
uint8_t
*
end
=
po
+
os
*
len
;
if
(
!
po
)
if
(
!
po
)
...
...
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