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
88345052
Commit
88345052
authored
Jul 10, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed memory leak of 1 audio(video?) buffer when quitting.
parent
14cc9765
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
src/input/decoder.c
src/input/decoder.c
+17
-15
No files found.
src/input/decoder.c
View file @
88345052
...
@@ -619,15 +619,19 @@ static inline void DecoderUpdatePreroll( int64_t *pi_preroll, const block_t *p )
...
@@ -619,15 +619,19 @@ static inline void DecoderUpdatePreroll( int64_t *pi_preroll, const block_t *p )
}
}
static
void
DecoderDecodeAudio
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
static
void
DecoderDecodeAudio
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
{
{
input_thread_t
*
p_input
=
p_dec
->
p_owner
->
p_input
;
input_thread_t
*
p_input
=
p_dec
->
p_owner
->
p_input
;
const
int
i_rate
=
p_block
->
i_rate
;
const
int
i_rate
=
p_block
->
i_rate
;
aout_buffer_t
*
p_aout_buf
;
aout_buffer_t
*
p_aout_buf
;
while
(
(
p_aout_buf
=
p_dec
->
pf_decode_audio
(
p_dec
,
&
p_block
))
)
while
(
(
p_aout_buf
=
p_dec
->
pf_decode_audio
(
p_dec
,
&
p_block
))
)
{
{
aout_instance_t
*
p_aout
=
p_dec
->
p_owner
->
p_aout
;
aout_input_t
*
p_aout_input
=
p_dec
->
p_owner
->
p_aout_input
;
if
(
p_dec
->
b_die
)
if
(
p_dec
->
b_die
)
{
{
/* It prevent freezing VLC in case of broken decoder */
/* It prevent freezing VLC in case of broken decoder */
aout_DecDeleteBuffer
(
p_aout
,
p_aout_input
,
p_aout_buf
);
if
(
p_block
)
if
(
p_block
)
block_Release
(
p_block
);
block_Release
(
p_block
);
break
;
break
;
...
@@ -638,8 +642,7 @@ static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
...
@@ -638,8 +642,7 @@ static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
if
(
p_aout_buf
->
start_date
<
p_dec
->
p_owner
->
i_preroll_end
)
if
(
p_aout_buf
->
start_date
<
p_dec
->
p_owner
->
i_preroll_end
)
{
{
aout_DecDeleteBuffer
(
p_dec
->
p_owner
->
p_aout
,
aout_DecDeleteBuffer
(
p_aout
,
p_aout_input
,
p_aout_buf
);
p_dec
->
p_owner
->
p_aout_input
,
p_aout_buf
);
continue
;
continue
;
}
}
...
@@ -649,9 +652,7 @@ static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
...
@@ -649,9 +652,7 @@ static void DecoderDecodeAudio( decoder_t *p_dec, block_t *p_block )
msg_Dbg
(
p_dec
,
"End of audio preroll"
);
msg_Dbg
(
p_dec
,
"End of audio preroll"
);
p_dec
->
p_owner
->
i_preroll_end
=
-
1
;
p_dec
->
p_owner
->
i_preroll_end
=
-
1
;
}
}
aout_DecPlay
(
p_dec
->
p_owner
->
p_aout
,
aout_DecPlay
(
p_aout
,
p_aout_input
,
p_aout_buf
,
i_rate
);
p_dec
->
p_owner
->
p_aout_input
,
p_aout_buf
,
i_rate
);
}
}
}
}
static
void
DecoderGetCc
(
decoder_t
*
p_dec
,
decoder_t
*
p_dec_cc
)
static
void
DecoderGetCc
(
decoder_t
*
p_dec
,
decoder_t
*
p_dec_cc
)
...
@@ -832,13 +833,15 @@ static void optimize_video_pts( decoder_t *p_dec )
...
@@ -832,13 +833,15 @@ static void optimize_video_pts( decoder_t *p_dec )
static
void
DecoderDecodeVideo
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
static
void
DecoderDecodeVideo
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
{
{
input_thread_t
*
p_input
=
p_dec
->
p_owner
->
p_input
;
input_thread_t
*
p_input
=
p_dec
->
p_owner
->
p_input
;
picture_t
*
p_pic
;
picture_t
*
p_pic
;
while
(
(
p_pic
=
p_dec
->
pf_decode_video
(
p_dec
,
&
p_block
))
)
while
(
(
p_pic
=
p_dec
->
pf_decode_video
(
p_dec
,
&
p_block
))
)
{
{
vout_thread_t
*
p_vout
=
p_dec
->
p_owner
->
p_vout
;
if
(
p_dec
->
b_die
)
if
(
p_dec
->
b_die
)
{
{
/* It prevent freezing VLC in case of broken decoder */
/* It prevent freezing VLC in case of broken decoder */
VoutDisplayedPicture
(
p_vout
,
p_pic
);
if
(
p_block
)
if
(
p_block
)
block_Release
(
p_block
);
block_Release
(
p_block
);
break
;
break
;
...
@@ -850,15 +853,15 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
...
@@ -850,15 +853,15 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
if
(
p_pic
->
date
<
p_dec
->
p_owner
->
i_preroll_end
)
if
(
p_pic
->
date
<
p_dec
->
p_owner
->
i_preroll_end
)
{
{
VoutDisplayedPicture
(
p_
dec
->
p_owner
->
p_
vout
,
p_pic
);
VoutDisplayedPicture
(
p_vout
,
p_pic
);
continue
;
continue
;
}
}
if
(
p_dec
->
p_owner
->
i_preroll_end
>
0
)
if
(
p_dec
->
p_owner
->
i_preroll_end
>
0
)
{
{
msg_Dbg
(
p_dec
,
"End of video preroll"
);
msg_Dbg
(
p_dec
,
"End of video preroll"
);
if
(
p_
dec
->
p_owner
->
p_
vout
)
if
(
p_vout
)
VoutFlushPicture
(
p_
dec
->
p_owner
->
p_
vout
);
VoutFlushPicture
(
p_vout
);
/* */
/* */
p_dec
->
p_owner
->
i_preroll_end
=
-
1
;
p_dec
->
p_owner
->
i_preroll_end
=
-
1
;
}
}
...
@@ -866,12 +869,11 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
...
@@ -866,12 +869,11 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
if
(
(
!
p_dec
->
p_owner
->
p_packetizer
||
!
p_dec
->
p_owner
->
p_packetizer
->
pf_get_cc
)
&&
p_dec
->
pf_get_cc
)
if
(
(
!
p_dec
->
p_owner
->
p_packetizer
||
!
p_dec
->
p_owner
->
p_packetizer
->
pf_get_cc
)
&&
p_dec
->
pf_get_cc
)
DecoderGetCc
(
p_dec
,
p_dec
);
DecoderGetCc
(
p_dec
,
p_dec
);
vout_DatePicture
(
p_dec
->
p_owner
->
p_vout
,
p_pic
,
vout_DatePicture
(
p_vout
,
p_pic
,
p_pic
->
date
);
p_pic
->
date
);
optimize_video_pts
(
p_dec
);
optimize_video_pts
(
p_dec
);
vout_DisplayPicture
(
p_
dec
->
p_owner
->
p_
vout
,
p_pic
);
vout_DisplayPicture
(
p_vout
,
p_pic
);
}
}
}
}
...
...
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