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
aa51f404
Commit
aa51f404
authored
Jun 13, 2010
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp4: find nal limits on 0*001 startcode instead 0001
parent
0023f19d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
modules/mux/mp4.c
modules/mux/mp4.c
+18
-11
No files found.
modules/mux/mp4.c
View file @
aa51f404
...
...
@@ -873,37 +873,44 @@ static bo_t *GetAvcCTag( mp4_stream_t *p_stream )
uint8_t
*
p_buffer
=
p_stream
->
fmt
.
p_extra
;
int
i_buffer
=
p_stream
->
fmt
.
i_extra
;
while
(
i_buffer
>
4
&&
p_buffer
[
0
]
==
0
&&
p_buffer
[
1
]
==
0
&&
p_buffer
[
2
]
==
0
&&
p_buffer
[
3
]
==
1
)
while
(
i_buffer
>
3
)
{
const
int
i_nal_type
=
p_buffer
[
4
]
&
0x1f
;
/* seek startcode */
while
(
p_buffer
[
0
]
!=
0
||
p_buffer
[
1
]
!=
0
||
p_buffer
[
2
]
!=
1
)
{
i_buffer
--
;
p_buffer
++
;
}
const
int
i_nal_type
=
p_buffer
[
3
]
&
0x1f
;
int
i_offset
=
1
;
int
i_size
=
0
;
int
i_startcode
=
0
;
//msg_Dbg( p_stream, "we found a startcode for NAL with TYPE:%d", i_nal_type );
for
(
i_offset
=
1
;
i_offset
+
3
<
i_buffer
;
i_offset
++
)
for
(
i_offset
=
1
;
i_offset
+
2
<
i_buffer
;
i_offset
++
)
{
if
(
p_buffer
[
i_offset
]
==
0
&&
p_buffer
[
i_offset
+
1
]
==
0
&&
p_buffer
[
i_offset
+
2
]
==
0
&&
p_buffer
[
i_offset
+
3
]
==
1
)
p_buffer
[
i_offset
+
2
]
==
1
)
{
/* we found another startcode */
i_startcode
=
i_offset
;
while
(
p_buffer
[
i_startcode
-
1
]
==
0
&&
i_startcode
>
0
)
i_startcode
--
;
break
;
}
}
i_size
=
i_startcode
?
i_startcode
:
i_buffer
;
if
(
i_nal_type
==
7
)
{
p_sps
=
&
p_buffer
[
4
];
i_sps_size
=
i_size
-
4
;
p_sps
=
&
p_buffer
[
3
];
i_sps_size
=
i_size
-
3
;
}
if
(
i_nal_type
==
8
)
{
p_pps
=
&
p_buffer
[
4
];
i_pps_size
=
i_size
-
4
;
p_pps
=
&
p_buffer
[
3
];
i_pps_size
=
i_size
-
3
;
}
i_buffer
-=
i_size
;
p_buffer
+=
i_size
;
...
...
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