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
6211bb6c
Commit
6211bb6c
authored
Jun 15, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added apple chapter support (used by HandBrake, close #808)
parent
9acaa4b2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
200 additions
and
53 deletions
+200
-53
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+33
-3
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+10
-0
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+157
-50
No files found.
modules/demux/mp4/libmp4.c
View file @
6211bb6c
...
...
@@ -238,11 +238,14 @@ static int MP4_NextBox( stream_t *p_stream, MP4_Box_t *p_box )
if
(
p_box
->
p_father
)
{
const
int
i_box_end
=
p_box
->
i_size
+
p_box
->
i_pos
;
const
int
i_father_end
=
p_box
->
p_father
->
i_size
+
p_box
->
p_father
->
i_pos
;
/* check if it's within p-father */
if
(
p_box
->
i_size
+
p_box
->
i_pos
>=
p_box
->
p_father
->
i_size
+
p_box
->
p_father
->
i_pos
)
if
(
i_box_end
>=
i_father_end
)
{
msg_Dbg
(
p_stream
,
"out of bound child"
);
if
(
i_box_end
>
i_father_end
)
msg_Dbg
(
p_stream
,
"out of bound child"
);
return
0
;
/* out of bound */
}
}
...
...
@@ -2220,6 +2223,32 @@ static void MP4_FreeBox_chpl( MP4_Box_t *p_box )
free
(
p_chpl
->
chapter
[
i
].
psz_name
);
}
static
int
MP4_ReadBox_tref_generic
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
unsigned
int
i
;
MP4_READBOX_ENTER
(
MP4_Box_data_tref_generic_t
);
p_box
->
data
.
p_tref_generic
->
i_track_ID
=
NULL
;
p_box
->
data
.
p_tref_generic
->
i_entry_count
=
i_read
/
sizeof
(
uint32_t
);
if
(
p_box
->
data
.
p_tref_generic
->
i_entry_count
>
0
)
p_box
->
data
.
p_tref_generic
->
i_track_ID
=
malloc
(
p_box
->
data
.
p_tref_generic
->
i_entry_count
*
sizeof
(
uint32_t
)
);
for
(
i
=
0
;
i
<
p_box
->
data
.
p_tref_generic
->
i_entry_count
;
i
++
)
{
MP4_GET4BYTES
(
p_box
->
data
.
p_tref_generic
->
i_track_ID
[
i
]
);
}
#ifdef MP4_VERBOSE
msg_Dbg
(
p_stream
,
"read box:
\"
chap
\"
%d references"
,
p_box
->
data
.
p_tref_generic
->
i_entry_count
);
#endif
MP4_READBOX_EXIT
(
1
);
}
static
void
MP4_FreeBox_tref_generic
(
MP4_Box_t
*
p_box
)
{
FREENULL
(
p_box
->
data
.
p_tref_generic
->
i_track_ID
);
}
static
int
MP4_ReadBox_meta
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
uint8_t
meta_data
[
8
];
...
...
@@ -2421,6 +2450,7 @@ static struct
{
FOURCC_dpnd
,
MP4_ReadBox_default
,
NULL
},
{
FOURCC_ipir
,
MP4_ReadBox_default
,
NULL
},
{
FOURCC_mpod
,
MP4_ReadBox_default
,
NULL
},
{
FOURCC_chap
,
MP4_ReadBox_tref_generic
,
MP4_FreeBox_tref_generic
},
/* found in hnti */
{
FOURCC_rtp
,
MP4_ReadBox_default
,
NULL
},
...
...
modules/demux/mp4/libmp4.h
View file @
6211bb6c
...
...
@@ -215,6 +215,8 @@
#define FOURCC_meta VLC_FOURCC( 'm', 'e', 't', 'a' )
#define FOURCC_ilst VLC_FOURCC( 'i', 'l', 's', 't' )
#define FOURCC_chap VLC_FOURCC( 'c', 'h', 'a', 'p' )
/* Do you want some debug information on all read boxes ? */
#define MP4_VERBOSE 1
...
...
@@ -791,6 +793,13 @@ typedef struct
}
MP4_Box_data_0xa9xxx_t
;
typedef
struct
{
uint32_t
i_entry_count
;
uint32_t
*
i_track_ID
;
}
MP4_Box_data_tref_generic_t
;
typedef
struct
{
uint8_t
i_version
;
...
...
@@ -887,6 +896,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_0xa9xxx_t
*
p_0xa9xxx
;
MP4_Box_data_chpl_t
*
p_chpl
;
MP4_Box_data_tref_generic_t
*
p_tref_generic
;
void
*
p_data
;
/* for unknow type */
}
MP4_Box_data_t
;
...
...
modules/demux/mp4/mp4.c
View file @
6211bb6c
This diff is collapsed.
Click to expand it.
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