Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
b2984add
Commit
b2984add
authored
15 years ago
by
Baptiste Coudurier
Browse files
Options
Downloads
Patches
Plain Diff
do not parse full header for private streams
Originally committed as revision 19075 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
617c4616
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/mpegts.c
+19
-3
19 additions, 3 deletions
libavformat/mpegts.c
with
19 additions
and
3 deletions
libavformat/mpegts.c
+
19
−
3
View file @
b2984add
...
@@ -128,13 +128,15 @@ struct MpegTSContext {
...
@@ -128,13 +128,15 @@ struct MpegTSContext {
enum
MpegTSState
{
enum
MpegTSState
{
MPEGTS_HEADER
=
0
,
MPEGTS_HEADER
=
0
,
MPEGTS_PESHEADER
,
MPEGTS_PESHEADER_FILL
,
MPEGTS_PESHEADER_FILL
,
MPEGTS_PAYLOAD
,
MPEGTS_PAYLOAD
,
MPEGTS_SKIP
,
MPEGTS_SKIP
,
};
};
/* enough for PES header + length */
/* enough for PES header + length */
#define PES_START_SIZE 9
#define PES_START_SIZE 6
#define PES_HEADER_SIZE 9
#define MAX_PES_HEADER_SIZE (9 + 255)
#define MAX_PES_HEADER_SIZE (9 + 255)
struct
PESContext
{
struct
PESContext
{
...
@@ -951,8 +953,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
...
@@ -951,8 +953,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
code
!=
0x1f0
&&
code
!=
0x1f1
&&
/* ECM, EMM */
code
!=
0x1f0
&&
code
!=
0x1f1
&&
/* ECM, EMM */
code
!=
0x1ff
&&
code
!=
0x1f2
&&
/* program_stream_directory, DSMCC_stream */
code
!=
0x1ff
&&
code
!=
0x1f2
&&
/* program_stream_directory, DSMCC_stream */
code
!=
0x1f8
)
{
/* ITU-T Rec. H.222.1 type E stream */
code
!=
0x1f8
)
{
/* ITU-T Rec. H.222.1 type E stream */
pes
->
state
=
MPEGTS_PESHEADER_FILL
;
pes
->
state
=
MPEGTS_PESHEADER
;
pes
->
pes_header_size
=
pes
->
header
[
8
]
+
9
;
}
else
{
}
else
{
pes
->
state
=
MPEGTS_PAYLOAD
;
pes
->
state
=
MPEGTS_PAYLOAD
;
pes
->
data_index
=
0
;
pes
->
data_index
=
0
;
...
@@ -968,6 +969,21 @@ static int mpegts_push_data(MpegTSFilter *filter,
...
@@ -968,6 +969,21 @@ static int mpegts_push_data(MpegTSFilter *filter,
break
;
break
;
/**********************************************/
/**********************************************/
/* PES packing parsing */
/* PES packing parsing */
case
MPEGTS_PESHEADER
:
len
=
PES_HEADER_SIZE
-
pes
->
data_index
;
if
(
len
<
0
)
return
-
1
;
if
(
len
>
buf_size
)
len
=
buf_size
;
memcpy
(
pes
->
header
+
pes
->
data_index
,
p
,
len
);
pes
->
data_index
+=
len
;
p
+=
len
;
buf_size
-=
len
;
if
(
pes
->
data_index
==
PES_HEADER_SIZE
)
{
pes
->
pes_header_size
=
pes
->
header
[
8
]
+
9
;
pes
->
state
=
MPEGTS_PESHEADER_FILL
;
}
break
;
case
MPEGTS_PESHEADER_FILL
:
case
MPEGTS_PESHEADER_FILL
:
len
=
pes
->
pes_header_size
-
pes
->
data_index
;
len
=
pes
->
pes_header_size
-
pes
->
data_index
;
if
(
len
<
0
)
if
(
len
<
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment