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
8fce437b
Commit
8fce437b
authored
Jan 25, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ffmpeg: fixed memory leaks.
parent
22d851e1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
40 deletions
+39
-40
modules/codec/faad/decoder.c
modules/codec/faad/decoder.c
+10
-9
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/audio.c
+22
-24
modules/codec/ffmpeg/audio.h
modules/codec/ffmpeg/audio.h
+7
-7
No files found.
modules/codec/faad/decoder.c
View file @
8fce437b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* decoder.c: AAC decoder using libfaad2
* decoder.c: AAC decoder using libfaad2
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: decoder.c,v 1.1
8 2003/01/08 10:43:27
fenrir Exp $
* $Id: decoder.c,v 1.1
9 2003/01/25 16:59:49
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -120,7 +120,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
...
@@ -120,7 +120,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
return
(
0
);
return
(
0
);
}
}
static
int
pi_channels_maps
[
6
]
=
static
unsigned
int
pi_channels_maps
[
6
]
=
{
{
0
,
0
,
AOUT_CHAN_CENTER
,
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
,
AOUT_CHAN_CENTER
,
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
,
...
@@ -209,6 +209,7 @@ static int InitThread( adec_thread_t * p_adec )
...
@@ -209,6 +209,7 @@ static int InitThread( adec_thread_t * p_adec )
{
{
msg_Warn
(
p_adec
->
p_fifo
,
msg_Warn
(
p_adec
->
p_fifo
,
"cannot load stream informations"
);
"cannot load stream informations"
);
memset
(
&
p_adec
->
format
,
0
,
sizeof
(
waveformatex_t
)
);
}
}
else
else
{
{
...
...
modules/codec/ffmpeg/audio.c
View file @
8fce437b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* audio.c: audio decoder using ffmpeg library
* audio.c: audio decoder using ffmpeg library
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: audio.c,v 1.1
2 2003/01/11 18:10
:49 fenrir Exp $
* $Id: audio.c,v 1.1
3 2003/01/25 16:59
:49 fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -71,7 +71,7 @@ static unsigned int pi_channels_maps[6] =
...
@@ -71,7 +71,7 @@ static unsigned int pi_channels_maps[6] =
/*****************************************************************************
/*****************************************************************************
* locales Functions
* locales Functions
*****************************************************************************/
*****************************************************************************/
#if 0
static void ffmpeg_GetWaveFormatEx( waveformatex_t *p_wh,
static void ffmpeg_GetWaveFormatEx( waveformatex_t *p_wh,
u8 *p_data )
u8 *p_data )
{
{
...
@@ -93,7 +93,7 @@ static void ffmpeg_GetWaveFormatEx( waveformatex_t *p_wh,
...
@@ -93,7 +93,7 @@ static void ffmpeg_GetWaveFormatEx( waveformatex_t *p_wh,
p_wh->i_size );
p_wh->i_size );
}
}
}
}
#endif
/*****************************************************************************
/*****************************************************************************
*
*
...
@@ -116,34 +116,31 @@ static void ffmpeg_GetWaveFormatEx( waveformatex_t *p_wh,
...
@@ -116,34 +116,31 @@ static void ffmpeg_GetWaveFormatEx( waveformatex_t *p_wh,
*****************************************************************************/
*****************************************************************************/
int
E_
(
InitThread_Audio
)(
adec_thread_t
*
p_adec
)
int
E_
(
InitThread_Audio
)(
adec_thread_t
*
p_adec
)
{
{
WAVEFORMATEX
*
p_wf
;
WAVEFORMATEX
wf
,
*
p_wf
;
if
(
(
p_wf
=
p_adec
->
p_fifo
->
p_waveformatex
)
!=
NULL
)
if
(
(
p_wf
=
p_adec
->
p_fifo
->
p_waveformatex
)
==
NULL
)
{
ffmpeg_GetWaveFormatEx
(
&
p_adec
->
format
,
(
uint8_t
*
)
p_wf
);
}
else
{
{
msg_Warn
(
p_adec
->
p_fifo
,
"audio informations missing"
);
msg_Warn
(
p_adec
->
p_fifo
,
"audio informations missing"
);
p_wf
=
&
wf
;
memset
(
p_wf
,
0
,
sizeof
(
WAVEFORMATEX
)
);
}
}
/* ***** Fill p_context with init values ***** */
/* ***** Fill p_context with init values ***** */
p_adec
->
p_context
->
sample_rate
=
p_
adec
->
format
.
i_samplespers
ec
;
p_adec
->
p_context
->
sample_rate
=
p_
wf
->
nSamplesPerS
ec
;
p_adec
->
p_context
->
channels
=
p_
adec
->
format
.
i_nb_c
hannels
;
p_adec
->
p_context
->
channels
=
p_
wf
->
nC
hannels
;
#if LIBAVCODEC_BUILD >= 4618
#if LIBAVCODEC_BUILD >= 4618
p_adec
->
p_context
->
block_align
=
p_
adec
->
format
.
i_blocka
lign
;
p_adec
->
p_context
->
block_align
=
p_
wf
->
nBlockA
lign
;
#endif
#endif
p_adec
->
p_context
->
bit_rate
=
p_
adec
->
format
.
i_avgbytespers
ec
*
8
;
p_adec
->
p_context
->
bit_rate
=
p_
wf
->
nAvgBytesPerS
ec
*
8
;
if
(
(
p_adec
->
p_context
->
extradata_size
=
p_
adec
->
format
.
i_s
ize
)
>
0
)
if
(
(
p_adec
->
p_context
->
extradata_size
=
p_
wf
->
cbS
ize
)
>
0
)
{
{
p_adec
->
p_context
->
extradata
=
p_adec
->
p_context
->
extradata
=
malloc
(
p_
adec
->
format
.
i_s
ize
);
malloc
(
p_
wf
->
cbS
ize
);
memcpy
(
p_adec
->
p_context
->
extradata
,
memcpy
(
p_adec
->
p_context
->
extradata
,
p_adec
->
format
.
p_data
,
&
p_wf
[
1
]
,
p_
adec
->
format
.
i_size
);
p_
wf
->
cbSize
);
}
}
/* ***** Open the codec ***** */
/* ***** Open the codec ***** */
...
@@ -165,10 +162,10 @@ int E_( InitThread_Audio )( adec_thread_t *p_adec )
...
@@ -165,10 +162,10 @@ int E_( InitThread_Audio )( adec_thread_t *p_adec )
p_adec
->
output_format
.
i_format
=
AOUT_FMT_S16_NE
;
p_adec
->
output_format
.
i_format
=
AOUT_FMT_S16_NE
;
p_adec
->
output_format
.
i_rate
=
p_
adec
->
format
.
i_samplespers
ec
;
p_adec
->
output_format
.
i_rate
=
p_
wf
->
nSamplesPerS
ec
;
p_adec
->
output_format
.
i_physical_channels
p_adec
->
output_format
.
i_physical_channels
=
p_adec
->
output_format
.
i_original_channels
=
p_adec
->
output_format
.
i_original_channels
=
p_
adec
->
format
.
i_nb_c
hannels
;
=
p_
wf
->
nC
hannels
;
p_adec
->
p_aout
=
NULL
;
p_adec
->
p_aout
=
NULL
;
p_adec
->
p_aout_input
=
NULL
;
p_adec
->
p_aout_input
=
NULL
;
...
@@ -355,7 +352,8 @@ usenextdata:
...
@@ -355,7 +352,8 @@ usenextdata:
*****************************************************************************/
*****************************************************************************/
void
E_
(
EndThread_Audio
)(
adec_thread_t
*
p_adec
)
void
E_
(
EndThread_Audio
)(
adec_thread_t
*
p_adec
)
{
{
FREE
(
p_adec
->
format
.
p_data
);
// FREE( p_adec->format.p_data );
FREE
(
p_adec
->
p_output
);
if
(
p_adec
->
p_aout_input
)
if
(
p_adec
->
p_aout_input
)
{
{
...
...
modules/codec/ffmpeg/audio.h
View file @
8fce437b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* audio.h: video decoder using ffmpeg library
* audio.h: video decoder using ffmpeg library
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: audio.h,v 1.
2 2002/11/14 22:38:47 massiot
Exp $
* $Id: audio.h,v 1.
3 2003/01/25 16:59:49 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -40,13 +40,13 @@ typedef struct adec_thread_s
...
@@ -40,13 +40,13 @@ typedef struct adec_thread_s
{
{
DECODER_THREAD_COMMON
DECODER_THREAD_COMMON
waveformatex_t
format
;
//
waveformatex_t format;
/*
/*
* Output properties
* Output properties
*/
*/
u
8
*
p_output
;
u
int8_t
*
p_output
;
aout_instance_t
*
p_aout
;
/* opaque */
aout_instance_t
*
p_aout
;
/* opaque */
aout_input_t
*
p_aout_input
;
/* opaque */
aout_input_t
*
p_aout_input
;
/* opaque */
...
...
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