Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
17b98fe8
Commit
17b98fe8
authored
Mar 09, 2018
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: libmp4: add forced box type reader
parent
8c217140
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
6 deletions
+36
-6
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+36
-6
No files found.
modules/demux/mp4/libmp4.c
View file @
17b98fe8
...
...
@@ -235,6 +235,8 @@ static uint8_t *mp4_readbox_enter( stream_t *s, MP4_Box_t *box,
* Some prototypes.
*****************************************************************************/
static
MP4_Box_t
*
MP4_ReadBox
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_father
);
static
MP4_Box_t
*
MP4_ReadBoxUsing
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_father
,
int
(
*
MP4_ReadBox_function
)(
stream_t
*
,
MP4_Box_t
*
)
);
static
int
MP4_Box_Read_Specific
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
,
MP4_Box_t
*
p_father
);
static
int
MP4_PeekBoxHeader
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
);
...
...
@@ -5113,11 +5115,7 @@ static int MP4_Box_Read_Specific( stream_t *p_stream, MP4_Box_t *p_box, MP4_Box_
return
VLC_SUCCESS
;
}
/*****************************************************************************
* MP4_ReadBox : parse the actual box and the children
* XXX : Do not go to the next box
*****************************************************************************/
static
MP4_Box_t
*
MP4_ReadBox
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_father
)
static
MP4_Box_t
*
MP4_ReadBoxAllocateCheck
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_father
)
{
MP4_Box_t
*
p_box
=
calloc
(
1
,
sizeof
(
MP4_Box_t
)
);
/* Needed to ensure simple on error handler */
if
(
p_box
==
NULL
)
...
...
@@ -5146,14 +5144,46 @@ static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, MP4_Box_t *p_father )
}
p_box
->
p_father
=
p_father
;
if
(
MP4_Box_Read_Specific
(
p_stream
,
p_box
,
p_father
)
!=
VLC_SUCCESS
)
return
p_box
;
}
/*****************************************************************************
* MP4_ReadBoxUsing : parse the actual box and the children using handler
*****************************************************************************/
static
MP4_Box_t
*
MP4_ReadBoxUsing
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_father
,
int
(
*
MP4_ReadBox_function
)(
stream_t
*
,
MP4_Box_t
*
)
)
{
MP4_Box_t
*
p_box
=
MP4_ReadBoxAllocateCheck
(
p_stream
,
p_father
);
if
(
!
p_box
)
return
NULL
;
if
(
MP4_ReadBox_function
(
p_stream
,
p_box
)
!=
VLC_SUCCESS
)
{
uint64_t
i_end
=
p_box
->
i_pos
+
p_box
->
i_size
;
MP4_BoxFree
(
p_box
);
MP4_Seek
(
p_stream
,
i_end
);
/* Skip the failed box */
return
NULL
;
}
return
p_box
;
}
/*****************************************************************************
* MP4_ReadBox : parse the actual box and the children
* XXX : Do not go to the next box
*****************************************************************************/
static
MP4_Box_t
*
MP4_ReadBox
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_father
)
{
MP4_Box_t
*
p_box
=
MP4_ReadBoxAllocateCheck
(
p_stream
,
p_father
);
if
(
!
p_box
)
return
NULL
;
if
(
MP4_Box_Read_Specific
(
p_stream
,
p_box
,
p_father
)
!=
VLC_SUCCESS
)
{
uint64_t
i_end
=
p_box
->
i_pos
+
p_box
->
i_size
;
MP4_BoxFree
(
p_box
);
MP4_Seek
(
p_stream
,
i_end
);
/* Skip the failed box */
return
NULL
;
}
return
p_box
;
}
...
...
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