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
7b3d4c9e
Commit
7b3d4c9e
authored
Oct 11, 2012
by
Frédéric Yhuel
Committed by
Jean-Baptiste Kempf
Oct 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux/mp4: rewrite MP4_BoxGetNextChunk()
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
1ef0c797
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
43 deletions
+1
-43
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+1
-43
No files found.
modules/demux/mp4/libmp4.c
View file @
7b3d4c9e
...
...
@@ -3492,13 +3492,10 @@ error:
return
NULL
;
}
#define MAX_SKIP 8
MP4_Box_t
*
MP4_BoxGetNextChunk
(
stream_t
*
s
)
{
/* p_chunk is a virtual root container for the moof and mdat boxes */
MP4_Box_t
*
p_chunk
;
MP4_Box_t
*
p_moof
=
NULL
;
MP4_Box_t
*
p_sidx
=
NULL
;
MP4_Box_t
*
p_tmp_box
=
NULL
;
p_tmp_box
=
calloc
(
1
,
sizeof
(
MP4_Box_t
)
);
...
...
@@ -3525,50 +3522,11 @@ MP4_Box_t *MP4_BoxGetNextChunk( stream_t *s )
p_chunk
->
i_type
=
ATOM_root
;
p_chunk
->
i_shortsize
=
1
;
/* there may be some boxes before moof,
* we skip them (but sidx) for now, but put a reasonable limit */
for
(
int
i
=
0
;
i
<
MAX_SKIP
;
i
++
)
{
p_moof
=
MP4_ReadBox
(
s
,
p_chunk
);
if
(
!
p_moof
)
goto
error
;
if
(
p_moof
->
i_type
!=
ATOM_moof
)
{
if
(
i
==
MAX_SKIP
-
1
)
{
MP4_BoxFree
(
s
,
p_moof
);
goto
error
;
}
if
(
p_moof
->
i_type
!=
ATOM_sidx
)
{
MP4_BoxFree
(
s
,
p_moof
);
stream_Read
(
s
,
NULL
,
p_moof
->
i_size
);
}
else
p_sidx
=
p_moof
;
}
else
break
;
}
p_chunk
->
p_first
=
p_moof
;
p_chunk
->
p_last
=
p_moof
;
if
(
p_sidx
)
{
p_chunk
->
p_first
=
p_sidx
;
p_sidx
->
p_next
=
p_moof
;
}
MP4_ReadBoxContainerChildren
(
s
,
p_chunk
,
ATOM_moof
);
return
p_chunk
;
error:
free
(
p_chunk
);
return
NULL
;
}
#undef MAX_SKIP
/*****************************************************************************
* MP4_BoxGetRoot : Parse the entire file, and create all boxes in memory
*****************************************************************************
...
...
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