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
acc5cdf9
Commit
acc5cdf9
authored
Jun 13, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: simplify destroy/release stuff
parent
ae78856f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
29 deletions
+24
-29
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+24
-29
No files found.
modules/demux/mp4/mp4.c
View file @
acc5cdf9
...
...
@@ -1718,7 +1718,7 @@ static void Close ( vlc_object_t * p_this )
{
MP4_TrackDestroy
(
p_demux
,
&
p_sys
->
track
[
i_track
]
);
}
FREENULL
(
p_sys
->
track
);
free
(
p_sys
->
track
);
if
(
p_sys
->
p_title
)
vlc_input_title_Delete
(
p_sys
->
p_title
);
...
...
@@ -2863,17 +2863,20 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
b_ok
=
p_track
->
b_chapter
||
!!
p_track
->
p_es
;
}
static
void
FreeAndReset
Chunk
(
mp4_chunk_t
*
ck
)
static
void
Destroy
Chunk
(
mp4_chunk_t
*
ck
)
{
free
(
ck
->
p_sample_count_dts
);
free
(
ck
->
p_sample_delta_dts
);
free
(
ck
->
p_sample_count_pts
);
free
(
ck
->
p_sample_offset_pts
);
free
(
ck
->
p_sample_size
);
if
(
ck
->
p_sample_data
)
{
for
(
uint32_t
i
=
0
;
i
<
ck
->
i_sample_count
;
i
++
)
free
(
ck
->
p_sample_data
[
i
]
);
free
(
ck
->
p_sample_data
);
memset
(
ck
,
0
,
sizeof
(
mp4_chunk_t
)
);
}
free
(
ck
->
p_sample_size
);
}
/****************************************************************************
...
...
@@ -2883,39 +2886,28 @@ static void FreeAndResetChunk( mp4_chunk_t *ck )
****************************************************************************/
static
void
MP4_TrackDestroy
(
demux_t
*
p_demux
,
mp4_track_t
*
p_track
)
{
unsigned
int
i_chunk
;
p_track
->
b_ok
=
false
;
p_track
->
b_enable
=
false
;
p_track
->
b_selected
=
false
;
es_format_Clean
(
&
p_track
->
fmt
);
if
(
p_track
->
p_es
)
es_out_Del
(
p_demux
->
out
,
p_track
->
p_es
);
for
(
i_chunk
=
0
;
i_chunk
<
p_track
->
i_chunk_count
;
i_chunk
++
)
{
if
(
p_track
->
chunk
)
{
FREENULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_count_dts
);
FREENULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_delta_dts
);
FREENULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_count_pts
);
FREENULL
(
p_track
->
chunk
[
i_chunk
].
p_sample_offset_pts
);
}
}
FREENULL
(
p_track
->
chunk
);
if
(
p_track
->
cchunk
)
{
FreeAndResetChunk
(
p_track
->
cchunk
);
FREENULL
(
p_track
->
cchunk
);
for
(
unsigned
int
i_chunk
=
0
;
i_chunk
<
p_track
->
i_chunk_count
;
i_chunk
++
)
DestroyChunk
(
&
p_track
->
chunk
[
i_chunk
]
);
}
free
(
p_track
->
chunk
);
if
(
!
p_track
->
i_sample_size
)
if
(
p_track
->
cchunk
)
{
FREENULL
(
p_track
->
p_sample_size
);
assert
(
p_demux
->
p_sys
->
b_fragmented
);
DestroyChunk
(
p_track
->
cchunk
);
free
(
p_track
->
cchunk
);
}
if
(
!
p_track
->
i_sample_size
)
free
(
p_track
->
p_sample_size
);
if
(
p_track
->
asfinfo
.
p_frame
)
block_ChainRelease
(
p_track
->
asfinfo
.
p_frame
);
}
...
...
@@ -3700,7 +3692,10 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
FlushChunk
(
p_demux
,
p_track
);
if
(
ret
->
i_sample_count
)
FreeAndResetChunk
(
ret
);
{
DestroyChunk
(
ret
);
memset
(
ret
,
0
,
sizeof
(
*
ret
)
);
}
MP4_Box_t
*
p_trun
=
MP4_BoxGet
(
p_traf
,
"trun"
);
if
(
p_trun
==
NULL
)
...
...
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