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
4e8d01f2
Commit
4e8d01f2
authored
Apr 29, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mpegts: Factorize version checking code out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ccb8f674
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
mpegts.c
libavformat/mpegts.c
+14
-8
No files found.
libavformat/mpegts.c
View file @
4e8d01f2
...
...
@@ -580,6 +580,16 @@ typedef struct SectionHeader {
uint8_t
last_sec_num
;
}
SectionHeader
;
static
int
skip_identical
(
const
SectionHeader
*
h
,
MpegTSSectionFilter
*
tssf
)
{
if
(
h
->
version
==
tssf
->
last_ver
)
return
1
;
tssf
->
last_ver
=
h
->
version
;
return
0
;
}
static
inline
int
get8
(
const
uint8_t
**
pp
,
const
uint8_t
*
p_end
)
{
const
uint8_t
*
p
;
...
...
@@ -1469,9 +1479,8 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section,
return
;
if
(
h
.
tid
!=
M4OD_TID
)
return
;
if
(
h
.
version
==
tssf
->
last_ver
)
if
(
skip_identical
(
&
h
,
tssf
)
)
return
;
tssf
->
last_ver
=
h
.
version
;
mp4_read_od
(
s
,
p
,
(
unsigned
)
(
p_end
-
p
),
mp4_descr
,
&
mp4_descr_count
,
MAX_MP4_DESCR_COUNT
);
...
...
@@ -1816,9 +1825,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
p
=
section
;
if
(
parse_section_header
(
h
,
&
p
,
p_end
)
<
0
)
return
;
if
(
h
->
version
==
tssf
->
last_ver
)
if
(
skip_identical
(
h
,
tssf
)
)
return
;
tssf
->
last_ver
=
h
->
version
;
av_log
(
ts
->
stream
,
AV_LOG_TRACE
,
"sid=0x%x sec_num=%d/%d version=%d
\n
"
,
h
->
id
,
h
->
sec_num
,
h
->
last_sec_num
,
h
->
version
);
...
...
@@ -1986,9 +1994,8 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if
(
ts
->
skip_changes
)
return
;
if
(
h
->
version
==
tssf
->
last_ver
)
if
(
skip_identical
(
h
,
tssf
)
)
return
;
tssf
->
last_ver
=
h
->
version
;
ts
->
stream
->
ts_id
=
h
->
id
;
clear_programs
(
ts
);
...
...
@@ -2061,9 +2068,8 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
return
;
if
(
ts
->
skip_changes
)
return
;
if
(
h
->
version
==
tssf
->
last_ver
)
if
(
skip_identical
(
h
,
tssf
)
)
return
;
tssf
->
last_ver
=
h
->
version
;
onid
=
get16
(
&
p
,
p_end
);
if
(
onid
<
0
)
...
...
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