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
c1111ae3
Commit
c1111ae3
authored
Nov 01, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: remove decoder_DeleteSubpicture() and fix a leak
parent
572925b6
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
12 additions
and
51 deletions
+12
-51
include/vlc_codec.h
include/vlc_codec.h
+2
-8
modules/codec/cvdsub.c
modules/codec/cvdsub.c
+1
-1
modules/codec/kate.c
modules/codec/kate.c
+2
-2
modules/codec/libass.c
modules/codec/libass.c
+1
-1
modules/codec/spudec/parse.c
modules/codec/spudec/parse.c
+2
-2
modules/codec/svcdsub.c
modules/codec/svcdsub.c
+1
-1
modules/codec/telx.c
modules/codec/telx.c
+1
-1
modules/codec/zvbi.c
modules/codec/zvbi.c
+1
-1
modules/stream_out/transcode/spu.c
modules/stream_out/transcode/spu.c
+1
-7
src/input/decoder.c
src/input/decoder.c
+0
-26
src/libvlccore.sym
src/libvlccore.sym
+0
-1
No files found.
include/vlc_codec.h
View file @
c1111ae3
...
@@ -109,9 +109,8 @@ struct decoder_t
...
@@ -109,9 +109,8 @@ struct decoder_t
int
(
*
pf_aout_format_update
)(
decoder_t
*
);
int
(
*
pf_aout_format_update
)(
decoder_t
*
);
/* SPU output callbacks
/* SPU output callbacks
* XXX use decoder_NewSubpicture
and decoder_DeleteSubpicture
*/
* XXX use decoder_NewSubpicture */
subpicture_t
*
(
*
pf_spu_buffer_new
)(
decoder_t
*
,
const
subpicture_updater_t
*
);
subpicture_t
*
(
*
pf_spu_buffer_new
)(
decoder_t
*
,
const
subpicture_updater_t
*
);
void
(
*
pf_spu_buffer_del
)(
decoder_t
*
,
subpicture_t
*
);
/* Input attachments
/* Input attachments
* XXX use decoder_GetInputAttachments */
* XXX use decoder_GetInputAttachments */
...
@@ -218,16 +217,11 @@ VLC_API block_t * decoder_NewAudioBuffer( decoder_t *, int i_size ) VLC_USED;
...
@@ -218,16 +217,11 @@ VLC_API block_t * decoder_NewAudioBuffer( decoder_t *, int i_size ) VLC_USED;
/**
/**
* This function will return a new subpicture usable by a decoder as an output
* This function will return a new subpicture usable by a decoder as an output
* buffer. You have to release it using
decoder_DeleteSubpicture
or by returning
* buffer. You have to release it using
subpicture_Delete()
or by returning
* it to the caller as a pf_decode_sub return value.
* it to the caller as a pf_decode_sub return value.
*/
*/
VLC_API
subpicture_t
*
decoder_NewSubpicture
(
decoder_t
*
,
const
subpicture_updater_t
*
)
VLC_USED
;
VLC_API
subpicture_t
*
decoder_NewSubpicture
(
decoder_t
*
,
const
subpicture_updater_t
*
)
VLC_USED
;
/**
* This function will release a subpicture created by decoder_NewSubicture.
*/
VLC_API
void
decoder_DeleteSubpicture
(
decoder_t
*
,
subpicture_t
*
p_subpicture
);
/**
/**
* This function gives all input attachments at once.
* This function gives all input attachments at once.
*
*
...
...
modules/codec/cvdsub.c
View file @
c1111ae3
...
@@ -526,7 +526,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
...
@@ -526,7 +526,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
if
(
!
p_region
)
if
(
!
p_region
)
{
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/codec/kate.c
View file @
c1111ae3
...
@@ -1261,7 +1261,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
...
@@ -1261,7 +1261,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
if
(
!
p_bitmap_region
)
if
(
!
p_bitmap_region
)
{
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
decoder_DeleteSubpictur
e
(
p_dec
,
p_spu
);
subpicture_Delet
e
(
p_dec
,
p_spu
);
return
NULL
;
return
NULL
;
}
}
...
@@ -1283,7 +1283,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
...
@@ -1283,7 +1283,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu,
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
if
(
p_bitmap_region
)
if
(
p_bitmap_region
)
subpicture_region_Delete
(
p_bitmap_region
);
subpicture_region_Delete
(
p_bitmap_region
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/codec/libass.c
View file @
c1111ae3
...
@@ -350,7 +350,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -350,7 +350,7 @@ static subpicture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_spu_sys
->
i_pts
=
p_block
->
i_pts
;
p_spu_sys
->
i_pts
=
p_block
->
i_pts
;
if
(
!
p_spu_sys
->
p_subs_data
)
if
(
!
p_spu_sys
->
p_subs_data
)
{
{
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
block_Release
(
p_block
);
block_Release
(
p_block
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/codec/spudec/parse.c
View file @
c1111ae3
...
@@ -113,7 +113,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
...
@@ -113,7 +113,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
if
(
ParseControlSeq
(
p_dec
,
p_spu
,
&
spu_data
,
&
spu_properties
,
p_sys
->
i_pts
)
)
if
(
ParseControlSeq
(
p_dec
,
p_spu
,
&
spu_data
,
&
spu_properties
,
p_sys
->
i_pts
)
)
{
{
/* There was a parse error, delete the subpicture */
/* There was a parse error, delete the subpicture */
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
return
NULL
;
return
NULL
;
}
}
...
@@ -131,7 +131,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
...
@@ -131,7 +131,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
if
(
ParseRLE
(
p_dec
,
&
spu_data
,
&
spu_properties
)
)
if
(
ParseRLE
(
p_dec
,
&
spu_data
,
&
spu_properties
)
)
{
{
/* There was a parse error, delete the subpicture */
/* There was a parse error, delete the subpicture */
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
free
(
spu_data
.
p_data
);
free
(
spu_data
.
p_data
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/codec/svcdsub.c
View file @
c1111ae3
...
@@ -465,7 +465,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
...
@@ -465,7 +465,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, block_t *p_data )
if
(
!
p_region
)
if
(
!
p_region
)
{
{
msg_Err
(
p_dec
,
"cannot allocate SVCD subtitle region"
);
msg_Err
(
p_dec
,
"cannot allocate SVCD subtitle region"
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/codec/telx.c
View file @
c1111ae3
...
@@ -722,7 +722,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
...
@@ -722,7 +722,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
error:
error:
if
(
p_spu
!=
NULL
)
if
(
p_spu
!=
NULL
)
{
{
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
p_spu
=
NULL
;
p_spu
=
NULL
;
}
}
...
...
modules/codec/zvbi.c
View file @
c1111ae3
...
@@ -523,7 +523,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
...
@@ -523,7 +523,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
if
(
p_spu
->
p_region
==
NULL
)
if
(
p_spu
->
p_region
==
NULL
)
{
{
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
msg_Err
(
p_dec
,
"cannot allocate SPU region"
);
decoder_DeleteSubpicture
(
p_dec
,
p_spu
);
subpicture_Delete
(
p_spu
);
return
NULL
;
return
NULL
;
}
}
...
...
modules/stream_out/transcode/spu.c
View file @
c1111ae3
...
@@ -45,11 +45,6 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
...
@@ -45,11 +45,6 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
return
p_subpicture
;
return
p_subpicture
;
}
}
static
void
spu_del_buffer
(
decoder_t
*
p_dec
,
subpicture_t
*
p_subpic
)
{
VLC_UNUSED
(
p_dec
);
subpicture_Delete
(
p_subpic
);
}
int
transcode_spu_new
(
sout_stream_t
*
p_stream
,
sout_stream_id_sys_t
*
id
)
int
transcode_spu_new
(
sout_stream_t
*
p_stream
,
sout_stream_id_sys_t
*
id
)
{
{
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
sout_stream_sys_t
*
p_sys
=
p_stream
->
p_sys
;
...
@@ -61,7 +56,6 @@ int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
...
@@ -61,7 +56,6 @@ int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
/* Initialization of decoder structures */
/* Initialization of decoder structures */
id
->
p_decoder
->
pf_decode_sub
=
NULL
;
id
->
p_decoder
->
pf_decode_sub
=
NULL
;
id
->
p_decoder
->
pf_spu_buffer_new
=
spu_new_buffer
;
id
->
p_decoder
->
pf_spu_buffer_new
=
spu_new_buffer
;
id
->
p_decoder
->
pf_spu_buffer_del
=
spu_del_buffer
;
id
->
p_decoder
->
p_owner
=
(
decoder_owner_sys_t
*
)
p_stream
;
id
->
p_decoder
->
p_owner
=
(
decoder_owner_sys_t
*
)
p_stream
;
/* id->p_decoder->p_cfg = p_sys->p_spu_cfg; */
/* id->p_decoder->p_cfg = p_sys->p_spu_cfg; */
...
@@ -151,7 +145,7 @@ int transcode_spu_process( sout_stream_t *p_stream,
...
@@ -151,7 +145,7 @@ int transcode_spu_process( sout_stream_t *p_stream,
block_t
*
p_block
;
block_t
*
p_block
;
p_block
=
id
->
p_encoder
->
pf_encode_sub
(
id
->
p_encoder
,
p_subpic
);
p_block
=
id
->
p_encoder
->
pf_encode_sub
(
id
->
p_encoder
,
p_subpic
);
s
pu_del_buffer
(
id
->
p_decoder
,
p_subpic
);
s
ubpicture_Delete
(
p_subpic
);
if
(
p_block
)
if
(
p_block
)
{
{
block_ChainAppend
(
out
,
p_block
);
block_ChainAppend
(
out
,
p_block
);
...
...
src/input/decoder.c
View file @
c1111ae3
...
@@ -70,7 +70,6 @@ static int vout_update_format( decoder_t * );
...
@@ -70,7 +70,6 @@ static int vout_update_format( decoder_t * );
static
picture_t
*
vout_new_buffer
(
decoder_t
*
);
static
picture_t
*
vout_new_buffer
(
decoder_t
*
);
static
int
aout_update_format
(
decoder_t
*
);
static
int
aout_update_format
(
decoder_t
*
);
static
subpicture_t
*
spu_new_buffer
(
decoder_t
*
,
const
subpicture_updater_t
*
);
static
subpicture_t
*
spu_new_buffer
(
decoder_t
*
,
const
subpicture_updater_t
*
);
static
void
spu_del_buffer
(
decoder_t
*
,
subpicture_t
*
);
struct
decoder_owner_sys_t
struct
decoder_owner_sys_t
{
{
...
@@ -192,11 +191,6 @@ subpicture_t *decoder_NewSubpicture( decoder_t *p_decoder,
...
@@ -192,11 +191,6 @@ subpicture_t *decoder_NewSubpicture( decoder_t *p_decoder,
return
p_subpicture
;
return
p_subpicture
;
}
}
void
decoder_DeleteSubpicture
(
decoder_t
*
p_decoder
,
subpicture_t
*
p_subpicture
)
{
p_decoder
->
pf_spu_buffer_del
(
p_decoder
,
p_subpicture
);
}
/* decoder_GetInputAttachments:
/* decoder_GetInputAttachments:
*/
*/
int
decoder_GetInputAttachments
(
decoder_t
*
p_dec
,
int
decoder_GetInputAttachments
(
decoder_t
*
p_dec
,
...
@@ -770,7 +764,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
...
@@ -770,7 +764,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
p_dec
->
pf_vout_format_update
=
vout_update_format
;
p_dec
->
pf_vout_format_update
=
vout_update_format
;
p_dec
->
pf_vout_buffer_new
=
vout_new_buffer
;
p_dec
->
pf_vout_buffer_new
=
vout_new_buffer
;
p_dec
->
pf_spu_buffer_new
=
spu_new_buffer
;
p_dec
->
pf_spu_buffer_new
=
spu_new_buffer
;
p_dec
->
pf_spu_buffer_del
=
spu_del_buffer
;
/* */
/* */
p_dec
->
pf_get_attachments
=
DecoderGetInputAttachments
;
p_dec
->
pf_get_attachments
=
DecoderGetInputAttachments
;
p_dec
->
pf_get_display_date
=
DecoderGetDisplayDate
;
p_dec
->
pf_get_display_date
=
DecoderGetDisplayDate
;
...
@@ -2218,22 +2211,3 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
...
@@ -2218,22 +2211,3 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
return
p_subpic
;
return
p_subpic
;
}
}
static
void
spu_del_buffer
(
decoder_t
*
p_dec
,
subpicture_t
*
p_subpic
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vout_thread_t
*
p_vout
=
NULL
;
p_vout
=
input_resource_HoldVout
(
p_owner
->
p_resource
);
if
(
!
p_vout
||
p_owner
->
p_spu_vout
!=
p_vout
)
{
if
(
p_vout
)
vlc_object_release
(
p_vout
);
msg_Warn
(
p_dec
,
"no vout found, leaking subpicture"
);
return
;
}
subpicture_Delete
(
p_subpic
);
vlc_object_release
(
p_vout
);
}
src/libvlccore.sym
View file @
c1111ae3
...
@@ -72,7 +72,6 @@ date_Increment
...
@@ -72,7 +72,6 @@ date_Increment
date_Init
date_Init
date_Move
date_Move
date_Set
date_Set
decoder_DeleteSubpicture
decoder_GetDisplayDate
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_GetDisplayRate
decoder_GetInputAttachments
decoder_GetInputAttachments
...
...
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