Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
3c96b5b8
Commit
3c96b5b8
authored
May 24, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: add trex helper and box checks
parent
e8f515ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+17
-7
No files found.
modules/demux/mp4/mp4.c
View file @
3c96b5b8
...
...
@@ -111,6 +111,8 @@ static void MP4_TrackSetELST( demux_t *, mp4_track_t *, int64_t );
static
void
MP4_UpdateSeekpoint
(
demux_t
*
);
static
const
char
*
MP4_ConvertMacCode
(
uint16_t
);
static
MP4_Box_t
*
MP4_GetTrexByTrackID
(
MP4_Box_t
*
p_moov
,
const
uint32_t
i_id
);
static
uint32_t
stream_ReadU32
(
stream_t
*
s
,
void
*
p_read
,
uint32_t
i_toread
)
{
uint32_t
i_return
=
0
;
...
...
@@ -126,6 +128,19 @@ static uint32_t stream_ReadU32( stream_t *s, void *p_read, uint32_t i_toread )
return
i_return
;
}
static
MP4_Box_t
*
MP4_GetTrexByTrackID
(
MP4_Box_t
*
p_moov
,
const
uint32_t
i_id
)
{
MP4_Box_t
*
p_trex
=
MP4_BoxGet
(
p_moov
,
"mvex/trex"
);
while
(
p_trex
)
{
if
(
p_trex
->
i_type
==
ATOM_trex
&&
BOXDATA
(
p_trex
)
->
i_track_ID
==
i_id
)
break
;
else
p_trex
=
p_trex
->
p_next
;
}
return
p_trex
;
}
/* Return time in microsecond of a track */
static
inline
int64_t
MP4_TrackGetDTS
(
demux_t
*
p_demux
,
mp4_track_t
*
p_track
)
{
...
...
@@ -3747,14 +3762,9 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
* more than one subsegment. */
if
(
!
default_duration
)
{
MP4_Box_t
*
p_trex
=
MP4_
BoxGet
(
p_demux
->
p_sys
->
p_root
,
"moov/mvex/trex"
);
MP4_Box_t
*
p_trex
=
MP4_
GetTrexByTrackID
(
p_moof
,
i_track_ID
);
if
(
p_trex
)
{
while
(
p_trex
&&
p_trex
->
data
.
p_trex
->
i_track_ID
!=
i_track_ID
)
p_trex
=
p_trex
->
p_next
;
if
(
p_trex
)
default_duration
=
BOXDATA
(
p_trex
)
->
i_default_sample_duration
;
}
default_duration
=
BOXDATA
(
p_trex
)
->
i_default_sample_duration
;
else
if
(
p_sidx
)
{
MP4_Box_data_sidx_t
*
p_sidx_data
=
BOXDATA
(
p_sidx
);
...
...
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