Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
9a9cfe84
Commit
9a9cfe84
authored
Feb 11, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec encoder: handle planar formats
Fix #8124
parent
ae764f12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+21
-6
No files found.
modules/codec/avcodec/encoder.c
View file @
9a9cfe84
...
...
@@ -1143,8 +1143,12 @@ static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
int
i_size
=
(
p_sys
->
i_frame_size
-
i_delay_size
)
*
p_sys
->
i_sample_bytes
;
memcpy
(
p_sys
->
p_buffer
+
i_delay_size
*
p_sys
->
i_sample_bytes
,
p_buffer
,
i_size
);
if
(
av_sample_fmt_is_planar
(
p_sys
->
p_context
->
sample_fmt
)
)
Deinterleave
(
&
p_sys
->
p_buffer
[
i_delay_size
*
p_sys
->
i_sample_bytes
],
p_buffer
,
i_samples_delay
,
p_enc
->
fmt_in
.
audio
.
i_channels
,
p_enc
->
fmt_in
.
i_codec
);
else
memcpy
(
p_sys
->
p_buffer
+
i_delay_size
*
p_sys
->
i_sample_bytes
,
p_buffer
,
i_size
);
p_buffer
-=
i_delay_size
*
p_sys
->
i_sample_bytes
;
i_samples
+=
i_samples_delay
;
i_samples_delay
=
0
;
...
...
@@ -1153,7 +1157,14 @@ static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
}
else
{
p_samples
=
p_buffer
;
if
(
av_sample_fmt_is_planar
(
p_sys
->
p_context
->
sample_fmt
)
)
{
Deinterleave
(
p_sys
->
p_buffer
,
p_buffer
,
p_sys
->
i_frame_size
,
p_enc
->
fmt_in
.
audio
.
i_channels
,
p_enc
->
fmt_in
.
i_codec
);
p_samples
=
p_sys
->
p_buffer
;
}
else
p_samples
=
p_buffer
;
}
i_out
=
avcodec_encode_audio
(
p_sys
->
p_context
,
p_sys
->
p_buffer_out
,
...
...
@@ -1186,9 +1197,13 @@ static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
/* Backup the remaining raw samples */
if
(
i_samples
)
{
memcpy
(
&
p_sys
->
p_buffer
[
i_samples_delay
*
p_sys
->
i_sample_bytes
],
p_buffer
,
i_samples
*
p_sys
->
i_sample_bytes
);
if
(
av_sample_fmt_is_planar
(
p_sys
->
p_context
->
sample_fmt
)
)
Deinterleave
(
&
p_sys
->
p_buffer
[
i_samples_delay
*
p_sys
->
i_sample_bytes
],
p_buffer
,
i_samples
,
p_enc
->
fmt_in
.
audio
.
i_channels
,
p_enc
->
fmt_in
.
i_codec
);
else
memcpy
(
&
p_sys
->
p_buffer
[
i_samples_delay
*
p_sys
->
i_sample_bytes
],
p_buffer
,
i_samples
*
p_sys
->
i_sample_bytes
);
}
return
p_chain
;
...
...
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