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
7e4baa66
Commit
7e4baa66
authored
Mar 17, 2007
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix indention
Originally committed as revision 8432 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
d9e1efb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
42 deletions
+42
-42
utils.c
libavformat/utils.c
+42
-42
No files found.
libavformat/utils.c
View file @
7e4baa66
...
@@ -600,14 +600,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
...
@@ -600,14 +600,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
/* do we have a video B frame ? */
/* do we have a video B frame ? */
delay
=
st
->
codec
->
has_b_frames
;
delay
=
st
->
codec
->
has_b_frames
;
presentation_delayed
=
0
;
presentation_delayed
=
0
;
/* XXX: need has_b_frame, but cannot get it if the codec is
/* XXX: need has_b_frame, but cannot get it if the codec is
not initialized */
not initialized */
if
(
delay
&&
if
(
delay
&&
pc
&&
pc
->
pict_type
!=
FF_B_TYPE
)
pc
&&
pc
->
pict_type
!=
FF_B_TYPE
)
presentation_delayed
=
1
;
presentation_delayed
=
1
;
/* this may be redundant, but it shouldnt hurt */
/* this may be redundant, but it shouldnt hurt */
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
>
pkt
->
dts
)
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
>
pkt
->
dts
)
presentation_delayed
=
1
;
presentation_delayed
=
1
;
if
(
st
->
cur_dts
==
AV_NOPTS_VALUE
){
if
(
st
->
cur_dts
==
AV_NOPTS_VALUE
){
st
->
cur_dts
=
-
delay
*
pkt
->
duration
;
st
->
cur_dts
=
-
delay
*
pkt
->
duration
;
...
@@ -615,43 +615,43 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
...
@@ -615,43 +615,43 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
// av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc);
// av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc);
/* interpolate PTS and DTS if they are not present */
/* interpolate PTS and DTS if they are not present */
if
(
delay
<=
1
){
if
(
delay
<=
1
){
if
(
presentation_delayed
)
{
if
(
presentation_delayed
)
{
/* DTS = decompression time stamp */
/* DTS = decompression time stamp */
/* PTS = presentation time stamp */
/* PTS = presentation time stamp */
if
(
pkt
->
dts
==
AV_NOPTS_VALUE
)
if
(
pkt
->
dts
==
AV_NOPTS_VALUE
)
pkt
->
dts
=
st
->
last_IP_pts
;
pkt
->
dts
=
st
->
last_IP_pts
;
if
(
pkt
->
dts
==
AV_NOPTS_VALUE
)
if
(
pkt
->
dts
==
AV_NOPTS_VALUE
)
pkt
->
dts
=
st
->
cur_dts
;
pkt
->
dts
=
st
->
cur_dts
;
/* this is tricky: the dts must be incremented by the duration
/* this is tricky: the dts must be incremented by the duration
of the frame we are displaying, i.e. the last I or P frame */
of the frame we are displaying, i.e. the last I or P frame */
if
(
st
->
last_IP_duration
==
0
)
if
(
st
->
last_IP_duration
==
0
)
st
->
last_IP_duration
=
pkt
->
duration
;
st
->
last_IP_duration
=
pkt
->
duration
;
st
->
cur_dts
=
pkt
->
dts
+
st
->
last_IP_duration
;
st
->
cur_dts
=
pkt
->
dts
+
st
->
last_IP_duration
;
st
->
last_IP_duration
=
pkt
->
duration
;
st
->
last_IP_duration
=
pkt
->
duration
;
st
->
last_IP_pts
=
pkt
->
pts
;
st
->
last_IP_pts
=
pkt
->
pts
;
/* cannot compute PTS if not present (we can compute it only
/* cannot compute PTS if not present (we can compute it only
by knowing the futur */
by knowing the futur */
}
else
{
}
else
{
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
pkt
->
duration
){
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
pkt
->
duration
){
int64_t
old_diff
=
FFABS
(
st
->
cur_dts
-
pkt
->
duration
-
pkt
->
pts
);
int64_t
old_diff
=
FFABS
(
st
->
cur_dts
-
pkt
->
duration
-
pkt
->
pts
);
int64_t
new_diff
=
FFABS
(
st
->
cur_dts
-
pkt
->
pts
);
int64_t
new_diff
=
FFABS
(
st
->
cur_dts
-
pkt
->
pts
);
if
(
old_diff
<
new_diff
&&
old_diff
<
(
pkt
->
duration
>>
3
)){
if
(
old_diff
<
new_diff
&&
old_diff
<
(
pkt
->
duration
>>
3
)){
pkt
->
pts
+=
pkt
->
duration
;
pkt
->
pts
+=
pkt
->
duration
;
// av_log(NULL, AV_LOG_DEBUG, "id:%d old:%"PRId64" new:%"PRId64" dur:%d cur:%"PRId64" size:%d\n", pkt->stream_index, old_diff, new_diff, pkt->duration, st->cur_dts, pkt->size);
// av_log(NULL, AV_LOG_DEBUG, "id:%d old:%"PRId64" new:%"PRId64" dur:%d cur:%"PRId64" size:%d\n", pkt->stream_index, old_diff, new_diff, pkt->duration, st->cur_dts, pkt->size);
}
}
}
}
/* presentation is not delayed : PTS and DTS are the same */
/* presentation is not delayed : PTS and DTS are the same */
if
(
pkt
->
pts
==
AV_NOPTS_VALUE
)
if
(
pkt
->
pts
==
AV_NOPTS_VALUE
)
pkt
->
pts
=
pkt
->
dts
;
pkt
->
pts
=
pkt
->
dts
;
if
(
pkt
->
pts
==
AV_NOPTS_VALUE
)
if
(
pkt
->
pts
==
AV_NOPTS_VALUE
)
pkt
->
pts
=
st
->
cur_dts
;
pkt
->
pts
=
st
->
cur_dts
;
pkt
->
dts
=
pkt
->
pts
;
pkt
->
dts
=
pkt
->
pts
;
st
->
cur_dts
=
pkt
->
pts
+
pkt
->
duration
;
st
->
cur_dts
=
pkt
->
pts
+
pkt
->
duration
;
}
}
}
}
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
){
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
){
st
->
pts_buffer
[
0
]
=
pkt
->
pts
;
st
->
pts_buffer
[
0
]
=
pkt
->
pts
;
...
...
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