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
a7503430
Commit
a7503430
authored
Oct 18, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: simplify by using FFMAX/FFMIN.
parent
f172132f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
utils.c
libavformat/utils.c
+6
-12
No files found.
libavformat/utils.c
View file @
a7503430
...
...
@@ -1848,27 +1848,22 @@ static void update_stream_timings(AVFormatContext *ic)
st
=
ic
->
streams
[
i
];
if
(
st
->
start_time
!=
AV_NOPTS_VALUE
&&
st
->
time_base
.
den
)
{
start_time1
=
av_rescale_q
(
st
->
start_time
,
st
->
time_base
,
AV_TIME_BASE_Q
);
if
(
start_time1
<
start_time
)
start_time
=
start_time1
;
start_time
=
FFMIN
(
start_time
,
start_time1
);
if
(
st
->
duration
!=
AV_NOPTS_VALUE
)
{
end_time1
=
start_time1
+
av_rescale_q
(
st
->
duration
,
st
->
time_base
,
AV_TIME_BASE_Q
);
if
(
end_time1
>
end_time
)
end_time
=
end_time1
;
end_time
=
FFMAX
(
end_time
,
end_time1
);
}
}
if
(
st
->
duration
!=
AV_NOPTS_VALUE
)
{
duration1
=
av_rescale_q
(
st
->
duration
,
st
->
time_base
,
AV_TIME_BASE_Q
);
if
(
duration1
>
duration
)
duration
=
duration1
;
duration
=
FFMAX
(
duration
,
duration1
);
}
}
if
(
start_time
!=
INT64_MAX
)
{
ic
->
start_time
=
start_time
;
if
(
end_time
!=
INT64_MIN
)
{
if
(
end_time
-
start_time
>
duration
)
duration
=
end_time
-
start_time
;
}
if
(
end_time
!=
INT64_MIN
)
duration
=
FFMAX
(
duration
,
end_time
-
start_time
);
}
if
(
duration
!=
INT64_MIN
)
{
ic
->
duration
=
duration
;
...
...
@@ -2022,8 +2017,7 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
file_size
=
0
;
}
else
{
file_size
=
avio_size
(
ic
->
pb
);
if
(
file_size
<
0
)
file_size
=
0
;
file_size
=
FFMAX
(
0
,
file_size
);
}
if
((
!
strcmp
(
ic
->
iformat
->
name
,
"mpeg"
)
||
...
...
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