Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
71148dd9
Commit
71148dd9
authored
Jun 10, 2006
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/codec/ffmpeg/audio.c: reduce memory usage a bit.
parent
fb220e50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/audio.c
+9
-2
No files found.
modules/codec/ffmpeg/audio.c
View file @
71148dd9
...
@@ -143,7 +143,7 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
...
@@ -143,7 +143,7 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) started"
,
p_sys
->
psz_namecodec
);
msg_Dbg
(
p_dec
,
"ffmpeg codec (%s) started"
,
p_sys
->
psz_namecodec
);
p_sys
->
p_output
=
malloc
(
3
*
AVCODEC_MAX_AUDIO_FRAME_SIZE
);
p_sys
->
p_output
=
malloc
(
AVCODEC_MAX_AUDIO_FRAME_SIZE
);
p_sys
->
p_samples
=
NULL
;
p_sys
->
p_samples
=
NULL
;
p_sys
->
i_samples
=
0
;
p_sys
->
i_samples
=
0
;
...
@@ -219,12 +219,19 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block )
...
@@ -219,12 +219,19 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block )
return
NULL
;
return
NULL
;
}
}
if
(
p_block
->
i_buffer
<=
0
||
(
p_block
->
i_flags
&
(
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
)
)
)
if
(
p_block
->
i_buffer
<=
0
||
(
p_block
->
i_flags
&
(
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
))
)
{
{
block_Release
(
p_block
);
block_Release
(
p_block
);
return
NULL
;
return
NULL
;
}
}
if
(
p_block
->
i_buffer
>
AVCODEC_MAX_AUDIO_FRAME_SIZE
)
{
/* Grow output buffer if necessary (eg. for PCM data) */
p_sys
->
p_output
=
realloc
(
p_sys
->
p_output
,
p_block
->
i_buffer
);
}
i_used
=
avcodec_decode_audio
(
p_sys
->
p_context
,
i_used
=
avcodec_decode_audio
(
p_sys
->
p_context
,
(
int16_t
*
)
p_sys
->
p_output
,
&
i_output
,
(
int16_t
*
)
p_sys
->
p_output
,
&
i_output
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
p_block
->
p_buffer
,
p_block
->
i_buffer
);
...
...
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