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
df889be0
Commit
df889be0
authored
May 29, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nutenc: avoid av_tree_find() operation per syncpoint
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6b041cb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
nutenc.c
libavformat/nutenc.c
+3
-7
No files found.
libavformat/nutenc.c
View file @
df889be0
...
...
@@ -991,7 +991,7 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
if
(
store_sp
&&
(
!
(
nut
->
flags
&
NUT_PIPE
)
||
nut
->
last_syncpoint_pos
==
INT_MIN
))
{
Syncpoint
*
sp
,
dummy
=
{
.
pos
=
INT64_MAX
}
;
int64_t
sp_pos
=
INT64_MAX
;
ff_nut_reset_ts
(
nut
,
*
nus
->
time_base
,
pkt
->
dts
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
...
...
@@ -1003,19 +1003,15 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
int
index
=
av_index_search_timestamp
(
st
,
dts_tb
,
AVSEEK_FLAG_BACKWARD
);
if
(
index
>=
0
)
dummy
.
pos
=
FFMIN
(
dummy
.
pos
,
st
->
index_entries
[
index
].
pos
);
sp_pos
=
FFMIN
(
sp_
pos
,
st
->
index_entries
[
index
].
pos
);
}
if
(
dummy
.
pos
==
INT64_MAX
)
dummy
.
pos
=
0
;
sp
=
av_tree_find
(
nut
->
syncpoints
,
&
dummy
,
(
void
*
)
ff_nut_sp_pos_cmp
,
NULL
);
nut
->
last_syncpoint_pos
=
avio_tell
(
bc
);
ret
=
avio_open_dyn_buf
(
&
dyn_bc
);
if
(
ret
<
0
)
return
ret
;
put_tt
(
nut
,
nus
->
time_base
,
dyn_bc
,
pkt
->
dts
);
ff_put_v
(
dyn_bc
,
sp
?
(
nut
->
last_syncpoint_pos
-
sp
->
pos
)
>>
4
:
0
);
ff_put_v
(
dyn_bc
,
sp
_pos
!=
INT64_MAX
?
(
nut
->
last_syncpoint_pos
-
sp_
pos
)
>>
4
:
0
);
if
(
nut
->
flags
&
NUT_BROADCAST
)
{
put_tt
(
nut
,
nus
->
time_base
,
dyn_bc
,
...
...
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