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
9f956d9d
Commit
9f956d9d
authored
Jan 23, 2014
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: apply misc cosmetics to process_input() code
parent
8456bd2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
ffmpeg.c
ffmpeg.c
+14
-16
No files found.
ffmpeg.c
View file @
9f956d9d
...
...
@@ -3198,22 +3198,21 @@ static int process_input(int file_index)
int64_t
pkt_dts
=
av_rescale_q
(
pkt
.
dts
,
ist
->
st
->
time_base
,
AV_TIME_BASE_Q
);
int64_t
delta
=
pkt_dts
-
ist
->
next_dts
;
if
(
is
->
iformat
->
flags
&
AVFMT_TS_DISCONT
)
{
if
(
delta
<
-
1LL
*
dts_delta_threshold
*
AV_TIME_BASE
||
(
delta
>
1LL
*
dts_delta_threshold
*
AV_TIME_BASE
&&
ist
->
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
)
||
pkt_dts
+
AV_TIME_BASE
/
10
<
FFMAX
(
ist
->
pts
,
ist
->
dts
))
{
ifile
->
ts_offset
-=
delta
;
av_log
(
NULL
,
AV_LOG_DEBUG
,
"timestamp discontinuity %"
PRId64
", new offset= %"
PRId64
"
\n
"
,
delta
,
ifile
->
ts_offset
);
pkt
.
dts
-=
av_rescale_q
(
delta
,
AV_TIME_BASE_Q
,
ist
->
st
->
time_base
);
if
(
pkt
.
pts
!=
AV_NOPTS_VALUE
)
pkt
.
pts
-=
av_rescale_q
(
delta
,
AV_TIME_BASE_Q
,
ist
->
st
->
time_base
);
}
if
(
delta
<
-
1LL
*
dts_delta_threshold
*
AV_TIME_BASE
||
(
delta
>
1LL
*
dts_delta_threshold
*
AV_TIME_BASE
&&
ist
->
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
)
||
pkt_dts
+
AV_TIME_BASE
/
10
<
FFMAX
(
ist
->
pts
,
ist
->
dts
))
{
ifile
->
ts_offset
-=
delta
;
av_log
(
NULL
,
AV_LOG_DEBUG
,
"timestamp discontinuity %"
PRId64
", new offset= %"
PRId64
"
\n
"
,
delta
,
ifile
->
ts_offset
);
pkt
.
dts
-=
av_rescale_q
(
delta
,
AV_TIME_BASE_Q
,
ist
->
st
->
time_base
);
if
(
pkt
.
pts
!=
AV_NOPTS_VALUE
)
pkt
.
pts
-=
av_rescale_q
(
delta
,
AV_TIME_BASE_Q
,
ist
->
st
->
time_base
);
}
}
else
{
if
(
delta
<
-
1LL
*
dts_error_threshold
*
AV_TIME_BASE
||
(
delta
>
1LL
*
dts_error_threshold
*
AV_TIME_BASE
&&
ist
->
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
)
)
{
(
delta
>
1LL
*
dts_error_threshold
*
AV_TIME_BASE
&&
ist
->
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
))
{
av_log
(
NULL
,
AV_LOG_WARNING
,
"DTS %"
PRId64
", next:%"
PRId64
" st:%d invalid dropping
\n
"
,
pkt
.
dts
,
ist
->
next_dts
,
pkt
.
stream_index
);
pkt
.
dts
=
AV_NOPTS_VALUE
;
}
...
...
@@ -3221,8 +3220,7 @@ static int process_input(int file_index)
int64_t
pkt_pts
=
av_rescale_q
(
pkt
.
pts
,
ist
->
st
->
time_base
,
AV_TIME_BASE_Q
);
delta
=
pkt_pts
-
ist
->
next_dts
;
if
(
delta
<
-
1LL
*
dts_error_threshold
*
AV_TIME_BASE
||
(
delta
>
1LL
*
dts_error_threshold
*
AV_TIME_BASE
&&
ist
->
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
)
)
{
(
delta
>
1LL
*
dts_error_threshold
*
AV_TIME_BASE
&&
ist
->
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
))
{
av_log
(
NULL
,
AV_LOG_WARNING
,
"PTS %"
PRId64
", next:%"
PRId64
" invalid dropping st:%d
\n
"
,
pkt
.
pts
,
ist
->
next_dts
,
pkt
.
stream_index
);
pkt
.
pts
=
AV_NOPTS_VALUE
;
}
...
...
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