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
ae618924
Commit
ae618924
authored
Jun 18, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used av_malloc/free for avcodec_decode_audio2 output buffer.
It is needed to ensure valid buffer alignment.
parent
9ef7e90e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+3
-3
No files found.
modules/codec/avcodec/audio.c
View file @
ae618924
...
@@ -197,7 +197,7 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
...
@@ -197,7 +197,7 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
if
(
p_sys
->
i_output_max
<
AVCODEC_MAX_AUDIO_FRAME_SIZE
)
if
(
p_sys
->
i_output_max
<
AVCODEC_MAX_AUDIO_FRAME_SIZE
)
p_sys
->
i_output_max
=
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
p_sys
->
i_output_max
=
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
msg_Dbg
(
p_dec
,
"Using %d bytes output buffer"
,
p_sys
->
i_output_max
);
msg_Dbg
(
p_dec
,
"Using %d bytes output buffer"
,
p_sys
->
i_output_max
);
p_sys
->
p_output
=
malloc
(
p_sys
->
i_output_max
);
p_sys
->
p_output
=
av_
malloc
(
p_sys
->
i_output_max
);
p_sys
->
p_samples
=
NULL
;
p_sys
->
p_samples
=
NULL
;
p_sys
->
i_samples
=
0
;
p_sys
->
i_samples
=
0
;
...
@@ -300,7 +300,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -300,7 +300,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
if
(
i_output
>
p_sys
->
i_output_max
)
if
(
i_output
>
p_sys
->
i_output_max
)
{
{
/* Grow output buffer if necessary (eg. for PCM data) */
/* Grow output buffer if necessary (eg. for PCM data) */
p_sys
->
p_output
=
realloc
(
p_sys
->
p_output
,
i_output
);
p_sys
->
p_output
=
av_
realloc
(
p_sys
->
p_output
,
i_output
);
}
}
*
pp_block
=
p_block
=
block_Realloc
(
p_block
,
0
,
p_block
->
i_buffer
+
FF_INPUT_BUFFER_PADDING_SIZE
);
*
pp_block
=
p_block
=
block_Realloc
(
p_block
,
0
,
p_block
->
i_buffer
+
FF_INPUT_BUFFER_PADDING_SIZE
);
...
@@ -384,7 +384,7 @@ void EndAudioDec( decoder_t *p_dec )
...
@@ -384,7 +384,7 @@ void EndAudioDec( decoder_t *p_dec )
{
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
free
(
p_sys
->
p_output
);
av_
free
(
p_sys
->
p_output
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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