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
f288e1b6
Commit
f288e1b6
authored
Feb 22, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/utils: factorize h264/hevc checks out in compute_pkt_fields()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8bcacd9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
utils.c
libavformat/utils.c
+4
-4
No files found.
libavformat/utils.c
View file @
f288e1b6
...
...
@@ -1072,6 +1072,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
int
num
,
den
,
presentation_delayed
,
delay
,
i
;
int64_t
offset
;
AVRational
duration
;
int
onein_oneout
=
st
->
codec
->
codec_id
!=
AV_CODEC_ID_H264
&&
st
->
codec
->
codec_id
!=
AV_CODEC_ID_HEVC
;
if
(
s
->
flags
&
AVFMT_FLAG_NOFILLIN
)
return
;
...
...
@@ -1154,8 +1156,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
/* Interpolate PTS and DTS if they are not present. We skip H264
* currently because delay and has_b_frames are not reliably set. */
if
((
delay
==
0
||
(
delay
==
1
&&
pc
))
&&
st
->
codec
->
codec_id
!=
AV_CODEC_ID_H264
&&
st
->
codec
->
codec_id
!=
AV_CODEC_ID_HEVC
)
{
onein_oneout
)
{
if
(
presentation_delayed
)
{
/* DTS = decompression timestamp */
/* PTS = presentation timestamp */
...
...
@@ -1200,8 +1201,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
pkt
->
dts
=
st
->
pts_buffer
[
0
];
}
// We skipped it above so we try here.
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_H264
||
st
->
codec
->
codec_id
==
AV_CODEC_ID_HEVC
)
if
(
!
onein_oneout
)
// This should happen on the first packet
update_initial_timestamps
(
s
,
pkt
->
stream_index
,
pkt
->
dts
,
pkt
->
pts
,
pkt
);
if
(
pkt
->
dts
>
st
->
cur_dts
)
...
...
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