Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
fe21f78d
Commit
fe21f78d
authored
Sep 28, 2011
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg probe: check the 2/4-bit synchronization value found after a pack_start_code.
parent
bf00a73a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
mpeg.c
libavformat/mpeg.c
+6
-1
No files found.
libavformat/mpeg.c
View file @
fe21f78d
...
...
@@ -49,6 +49,10 @@ static int check_pes(uint8_t *p, uint8_t *end){
return
pes1
||
pes2
;
}
static
int
check_pack_header
(
const
uint8_t
*
buf
)
{
return
(
buf
[
1
]
&
0xC0
)
==
0x40
||
(
buf
[
1
]
&
0xF0
)
==
0x20
;
}
static
int
mpegps_probe
(
AVProbeData
*
p
)
{
uint32_t
code
=
-
1
;
...
...
@@ -61,9 +65,10 @@ static int mpegps_probe(AVProbeData *p)
if
((
code
&
0xffffff00
)
==
0x100
)
{
int
len
=
p
->
buf
[
i
+
1
]
<<
8
|
p
->
buf
[
i
+
2
];
int
pes
=
check_pes
(
p
->
buf
+
i
,
p
->
buf
+
p
->
buf_size
);
int
pack
=
check_pack_header
(
p
->
buf
+
i
);
if
(
code
==
SYSTEM_HEADER_START_CODE
)
sys
++
;
else
if
(
code
==
PACK_START_CODE
)
pspack
++
;
else
if
(
code
==
PACK_START_CODE
&&
pack
)
pspack
++
;
else
if
((
code
&
0xf0
)
==
VIDEO_ID
&&
pes
)
vid
++
;
// skip pes payload to avoid start code emulation for private
// and audio streams
...
...
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