Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e822c237
Commit
e822c237
authored
May 04, 2011
by
JULIAN GARDNER
Committed by
Michael Niedermayer
May 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvbsubdec: Split delete_state()
parent
9522a752
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
18 deletions
+38
-18
dvbsubdec.c
libavcodec/dvbsubdec.c
+38
-18
No files found.
libavcodec/dvbsubdec.c
View file @
e822c237
...
...
@@ -321,21 +321,10 @@ static void delete_region_display_list(DVBSubContext *ctx, DVBSubRegion *region)
}
static
void
delete_
state
(
DVBSubContext
*
ctx
)
static
void
delete_
cluts
(
DVBSubContext
*
ctx
)
{
DVBSubRegion
*
region
;
DVBSubCLUT
*
clut
;
while
(
ctx
->
region_list
)
{
region
=
ctx
->
region_list
;
ctx
->
region_list
=
region
->
next
;
delete_region_display_list
(
ctx
,
region
);
av_free
(
region
->
pbuf
);
av_free
(
region
);
}
while
(
ctx
->
clut_list
)
{
clut
=
ctx
->
clut_list
;
...
...
@@ -343,12 +332,35 @@ static void delete_state(DVBSubContext *ctx)
av_free
(
clut
);
}
}
av_freep
(
&
ctx
->
display_definition
);
static
void
delete_objects
(
DVBSubContext
*
ctx
)
{
DVBSubObject
*
object
;
/* Should already be null */
if
(
ctx
->
object_list
)
av_log
(
0
,
AV_LOG_ERROR
,
"Memory deallocation error!
\n
"
);
while
(
ctx
->
object_list
)
{
object
=
ctx
->
object_list
;
ctx
->
object_list
=
object
->
next
;
av_free
(
object
);
}
}
static
void
delete_regions
(
DVBSubContext
*
ctx
)
{
DVBSubRegion
*
region
;
while
(
ctx
->
region_list
)
{
region
=
ctx
->
region_list
;
ctx
->
region_list
=
region
->
next
;
delete_region_display_list
(
ctx
,
region
);
av_free
(
region
->
pbuf
);
av_free
(
region
);
}
}
static
av_cold
int
dvbsub_init_decoder
(
AVCodecContext
*
avctx
)
...
...
@@ -433,7 +445,13 @@ static av_cold int dvbsub_close_decoder(AVCodecContext *avctx)
DVBSubContext
*
ctx
=
avctx
->
priv_data
;
DVBSubRegionDisplay
*
display
;
delete_state
(
ctx
);
delete_regions
(
ctx
);
delete_objects
(
ctx
);
delete_cluts
(
ctx
);
av_freep
(
&
ctx
->
display_definition
);
while
(
ctx
->
display_list
)
{
display
=
ctx
->
display_list
;
...
...
@@ -1125,7 +1143,9 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
av_dlog
(
avctx
,
"Page time out %ds, state %d
\n
"
,
ctx
->
time_out
,
page_state
);
if
(
page_state
==
2
)
{
delete_state
(
ctx
);
delete_regions
(
ctx
);
delete_objects
(
ctx
);
delete_cluts
(
ctx
);
}
tmp_display_list
=
ctx
->
display_list
;
...
...
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