Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
dca61827
Commit
dca61827
authored
Dec 21, 2000
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed various memory leaks.
parent
c570d9bc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
26 deletions
+66
-26
src/ac3_decoder/ac3_decoder_thread.c
src/ac3_decoder/ac3_decoder_thread.c
+3
-2
src/audio_decoder/audio_decoder.c
src/audio_decoder/audio_decoder.c
+3
-2
src/input/input.c
src/input/input.c
+26
-6
src/input/input.h
src/input/input.h
+2
-1
src/input/input_programs.c
src/input/input_programs.c
+27
-1
src/input/input_ps.c
src/input/input_ps.c
+2
-1
src/spu_decoder/spu_decoder.c
src/spu_decoder/spu_decoder.c
+1
-3
src/video_parser/video_parser.c
src/video_parser/video_parser.c
+2
-10
No files found.
src/ac3_decoder/ac3_decoder_thread.c
View file @
dca61827
...
...
@@ -2,7 +2,7 @@
* ac3_decoder_thread.c: ac3 decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder_thread.c,v 1.
19 2000/12/21 13:25:50
massiot Exp $
* $Id: ac3_decoder_thread.c,v 1.
20 2000/12/21 14:18:15
massiot Exp $
*
* Authors:
*
...
...
@@ -321,7 +321,8 @@ static void EndThread (ac3dec_thread_t * p_ac3dec)
}
/* Destroy descriptor */
free
(
p_ac3dec
);
free
(
p_ac3dec
->
p_config
);
free
(
p_ac3dec
);
intf_DbgMsg
(
"ac3dec debug: ac3 decoder thread %p destroyed
\n
"
,
p_ac3dec
);
}
...
...
src/audio_decoder/audio_decoder.c
View file @
dca61827
...
...
@@ -2,7 +2,7 @@
* audio_decoder.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_decoder.c,v 1.4
0 2000/12/21 13:25:50
massiot Exp $
* $Id: audio_decoder.c,v 1.4
1 2000/12/21 14:18:15
massiot Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
...
...
@@ -320,7 +320,8 @@ static void EndThread ( adec_thread_t *p_adec )
vlc_mutex_unlock
(
&
(
p_adec
->
p_aout_fifo
->
data_lock
));
}
/* Destroy descriptor */
free
(
p_adec
);
free
(
p_adec
->
p_config
);
free
(
p_adec
);
intf_DbgMsg
(
"adec debug: audio decoder thread %p destroyed
\n
"
,
p_adec
);
}
...
...
src/input/input.c
View file @
dca61827
...
...
@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.6
1 2000/12/21 13:54
:15 massiot Exp $
* $Id: input.c,v 1.6
2 2000/12/21 14:18
:15 massiot Exp $
*
* Authors:
*
...
...
@@ -316,18 +316,38 @@ static void EndThread( input_thread_t * p_input )
for
(
i_es_loop
=
0
;
i_es_loop
<
p_input
->
i_selected_es_number
;
i_es_loop
++
)
{
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_decoder_fifo
->
b_die
=
1
;
/* Make sure the thread leaves the GetByte() function */
vlc_mutex_lock
(
&
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_decoder_fifo
->
data_lock
);
vlc_cond_signal
(
&
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_decoder_fifo
->
data_wait
);
vlc_mutex_unlock
(
&
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_decoder_fifo
->
data_lock
);
decoder_fifo_t
*
p_decoder_fifo
;
p_decoder_fifo
=
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_decoder_fifo
;
p_decoder_fifo
->
b_die
=
1
;
/* Make sure the thread leaves the NextDataPacket() function */
vlc_mutex_lock
(
&
p_decoder_fifo
->
data_lock
);
vlc_cond_signal
(
&
p_decoder_fifo
->
data_wait
);
vlc_mutex_unlock
(
&
p_decoder_fifo
->
data_lock
);
/* Waiting for the thread to exit */
vlc_thread_join
(
p_input
->
pp_selected_es
[
i_es_loop
]
->
thread_id
);
/* Freeing all packets still in the decoder fifo. */
while
(
!
DECODER_FIFO_ISEMPTY
(
*
p_decoder_fifo
)
)
{
p_decoder_fifo
->
pf_delete_pes
(
p_decoder_fifo
->
p_packets_mgt
,
DECODER_FIFO_START
(
*
p_decoder_fifo
)
);
DECODER_FIFO_INCSTART
(
*
p_decoder_fifo
);
}
free
(
p_input
->
pp_selected_es
[
i_es_loop
]
->
p_decoder_fifo
);
}
/* Free demultiplexer's data */
p_input
->
p_plugin
->
pf_end
(
p_input
);
free
(
p_input
->
p_plugin
);
/* Free input structures */
input_EndStream
(
p_input
);
free
(
p_input
->
pp_es
);
free
(
p_input
->
pp_selected_es
);
free
(
p_input
);
/* Update status */
*
pi_status
=
THREAD_OVER
;
...
...
src/input/input.h
View file @
dca61827
...
...
@@ -2,7 +2,7 @@
* input.h: structures of the input not exported to other modules
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input.h,v 1.
4 2000/12/20 16:04:31
massiot Exp $
* $Id: input.h,v 1.
5 2000/12/21 14:18:15
massiot Exp $
*
* Authors:
*
...
...
@@ -77,6 +77,7 @@ void NextDataPacket ( struct bit_stream_s * );
* Prototypes from input_programs.c
*****************************************************************************/
void
input_InitStream
(
struct
input_thread_s
*
,
size_t
);
void
input_EndStream
(
struct
input_thread_s
*
);
struct
pgrm_descriptor_s
*
input_AddProgram
(
struct
input_thread_s
*
,
u16
,
size_t
);
void
input_DelProgram
(
struct
input_thread_s
*
,
u16
);
...
...
src/input/input_programs.c
View file @
dca61827
...
...
@@ -3,7 +3,7 @@
* FIXME : check the return value of realloc() and malloc() !
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.1
1 2000/12/21 13:54
:15 massiot Exp $
* $Id: input_programs.c,v 1.1
2 2000/12/21 14:18
:15 massiot Exp $
*
* Authors:
*
...
...
@@ -65,6 +65,32 @@ void input_InitStream( input_thread_t * p_input, size_t i_data_len )
}
}
/*****************************************************************************
* input_EndStream: free all stream descriptors
*****************************************************************************/
void
input_EndStream
(
input_thread_t
*
p_input
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
p_input
->
stream
.
i_pgrm_number
;
i
++
)
{
for
(
j
=
0
;
j
<
p_input
->
stream
.
pp_programs
[
i
]
->
i_es_number
;
j
++
)
{
if
(
p_input
->
stream
.
pp_programs
[
i
]
->
pp_es
[
j
]
->
p_demux_data
!=
NULL
)
{
free
(
p_input
->
stream
.
pp_programs
[
i
]
->
pp_es
[
j
]
->
p_demux_data
);
}
free
(
p_input
->
stream
.
pp_programs
[
i
]
->
pp_es
[
j
]
);
}
if
(
p_input
->
stream
.
pp_programs
[
i
]
->
p_demux_data
!=
NULL
)
{
free
(
p_input
->
stream
.
pp_programs
[
i
]
->
p_demux_data
);
}
free
(
p_input
->
stream
.
pp_programs
[
i
]
);
}
}
/*****************************************************************************
* input_AddProgram: add and init a program descriptor
*****************************************************************************
...
...
src/input/input_ps.c
View file @
dca61827
...
...
@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.
8 2000/12/20 18:45:43
massiot Exp $
* $Id: input_ps.c,v 1.
9 2000/12/21 14:18:15
massiot Exp $
*
* Authors:
*
...
...
@@ -417,6 +417,7 @@ input_capabilities_t * PSKludge( void )
p_plugin
=
(
input_capabilities_t
*
)
malloc
(
sizeof
(
input_capabilities_t
)
);
p_plugin
->
pf_init
=
PSInit
;
p_plugin
->
pf_end
=
PSEnd
;
p_plugin
->
pf_read
=
PSRead
;
p_plugin
->
pf_demux
=
input_DemuxPS
;
/* FIXME: use i_p_config_t ! */
p_plugin
->
pf_new_packet
=
NewPacket
;
...
...
src/spu_decoder/spu_decoder.c
View file @
dca61827
...
...
@@ -20,9 +20,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/* repomp sur video_decoder.c
* FIXME: passer en terminate/destroy avec les signaux supplmentaires ?? */
/*****************************************************************************
* Preamble
*****************************************************************************/
...
...
@@ -364,6 +361,7 @@ static void ErrorThread( spudec_thread_t *p_spudec )
static
void
EndThread
(
spudec_thread_t
*
p_spudec
)
{
intf_DbgMsg
(
"spudec debug: destroying spu decoder thread %p
\n
"
,
p_spudec
);
free
(
p_spudec
->
p_config
);
free
(
p_spudec
);
intf_DbgMsg
(
"spudec debug: spu decoder thread %p destroyed
\n
"
,
p_spudec
);
}
...
...
src/video_parser/video_parser.c
View file @
dca61827
...
...
@@ -2,7 +2,7 @@
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.5
5 2000/12/21 13:25:51
massiot Exp $
* $Id: video_parser.c,v 1.5
6 2000/12/21 14:18:15
massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
...
...
@@ -313,11 +313,6 @@ static void EndThread( vpar_thread_t *p_vpar )
intf_DbgMsg
(
"vpar debug: destroying video parser thread %p
\n
"
,
p_vpar
);
#ifdef DEBUG
/* Check for remaining PES packets */
/* XXX?? */
#endif
#ifdef STATS
intf_Msg
(
"vpar stats: %d loops among %d sequence(s)
\n
"
,
p_vpar
->
c_loops
,
p_vpar
->
c_sequences
);
...
...
@@ -361,10 +356,6 @@ static void EndThread( vpar_thread_t *p_vpar )
S
.
i_matrix_coefficients
);
#endif
/* Destroy thread structures allocated by InitThread */
// vout_DestroyStream( p_vpar->p_vout, p_vpar->i_stream );
/* XXX?? */
/* Dispose of matrices if they have been allocated. */
if
(
p_vpar
->
sequence
.
intra_quant
.
b_allocated
)
{
...
...
@@ -396,6 +387,7 @@ static void EndThread( vpar_thread_t *p_vpar )
free
(
p_vpar
->
pp_vdec
[
0
]
);
#endif
free
(
p_vpar
->
p_config
);
free
(
p_vpar
);
intf_DbgMsg
(
"vpar debug: EndThread(%p)
\n
"
,
p_vpar
);
...
...
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