Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
45032ec3
Commit
45032ec3
authored
Dec 28, 2012
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: handle planar samples from libavcodec
parent
dc56d394
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+22
-6
No files found.
modules/codec/avcodec/audio.c
View file @
45032ec3
...
...
@@ -221,6 +221,7 @@ static block_t *SplitBuffer( decoder_t *p_dec )
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
int
i_samples
=
__MIN
(
p_sys
->
i_samples
,
4096
);
int
sample_planar
=
0
;
block_t
*
p_buffer
;
if
(
i_samples
==
0
)
return
NULL
;
...
...
@@ -232,16 +233,26 @@ static block_t *SplitBuffer( decoder_t *p_dec )
p_buffer
->
i_length
=
date_Increment
(
&
p_sys
->
end_date
,
i_samples
)
-
p_buffer
->
i_pts
;
sample_planar
=
av_sample_fmt_is_planar
(
p_sys
->
p_context
->
sample_fmt
);
if
(
sample_planar
)
aout_Interleave
(
p_buffer
->
p_buffer
,
p_sys
->
p_samples
,
i_samples
,
p_sys
->
p_context
->
channels
,
p_dec
->
fmt_out
.
audio
.
i_format
);
if
(
p_sys
->
b_extract
)
{
if
(
sample_planar
)
memcpy
(
p_sys
->
p_samples
,
p_buffer
->
p_buffer
,
p_buffer
->
i_buffer
);
aout_ChannelExtract
(
p_buffer
->
p_buffer
,
p_dec
->
fmt_out
.
audio
.
i_channels
,
p_sys
->
p_samples
,
p_sys
->
p_context
->
channels
,
i_samples
,
p_sys
->
pi_extraction
,
p_dec
->
fmt_out
.
audio
.
i_bitspersample
);
else
}
else
if
(
!
sample_planar
)
memcpy
(
p_buffer
->
p_buffer
,
p_sys
->
p_samples
,
p_buffer
->
i_buffer
);
p_sys
->
p_samples
+=
i_samples
*
p_sys
->
p_context
->
channels
*
(
p_dec
->
fmt_out
.
audio
.
i_bitspersample
/
8
);
p_sys
->
i_samples
-=
i_samples
;
return
p_buffer
;
}
...
...
@@ -410,11 +421,16 @@ void EndAudioDec( decoder_t *p_dec )
vlc_fourcc_t
GetVlcAudioFormat
(
int
fmt
)
{
static
const
vlc_fourcc_t
fcc
[]
=
{
[
AV_SAMPLE_FMT_U8
]
=
VLC_CODEC_U8
,
[
AV_SAMPLE_FMT_S16
]
=
VLC_CODEC_S16N
,
[
AV_SAMPLE_FMT_S32
]
=
VLC_CODEC_S32N
,
[
AV_SAMPLE_FMT_FLT
]
=
VLC_CODEC_FL32
,
[
AV_SAMPLE_FMT_DBL
]
=
VLC_CODEC_FL64
,
[
AV_SAMPLE_FMT_U8
]
=
VLC_CODEC_U8
,
[
AV_SAMPLE_FMT_S16
]
=
VLC_CODEC_S16N
,
[
AV_SAMPLE_FMT_S32
]
=
VLC_CODEC_S32N
,
[
AV_SAMPLE_FMT_FLT
]
=
VLC_CODEC_FL32
,
[
AV_SAMPLE_FMT_DBL
]
=
VLC_CODEC_FL64
,
[
AV_SAMPLE_FMT_U8P
]
=
VLC_CODEC_U8
,
[
AV_SAMPLE_FMT_S16P
]
=
VLC_CODEC_S16N
,
[
AV_SAMPLE_FMT_S32P
]
=
VLC_CODEC_S32N
,
[
AV_SAMPLE_FMT_FLTP
]
=
VLC_CODEC_FL32
,
[
AV_SAMPLE_FMT_DBLP
]
=
VLC_CODEC_FL64
,
};
if
(
sizeof
(
fcc
)
/
sizeof
(
fcc
[
0
])
<
(
unsigned
)
fmt
)
return
fcc
[
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