Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
dav1d
Commits
c2e0490c
Verified
Commit
c2e0490c
authored
Feb 14, 2019
by
James Almer
Browse files
lib: also free internal buffers when flushing with one frame thread
parent
d5cc8503
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib.c
View file @
c2e0490c
...
...
@@ -392,6 +392,22 @@ void dav1d_flush(Dav1dContext *const c) {
dav1d_data_unref_internal
(
&
c
->
in
);
c
->
drain
=
0
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
if
(
c
->
refs
[
i
].
p
.
p
.
data
[
0
])
dav1d_thread_picture_unref
(
&
c
->
refs
[
i
].
p
);
dav1d_ref_dec
(
&
c
->
refs
[
i
].
segmap
);
dav1d_ref_dec
(
&
c
->
refs
[
i
].
refmvs
);
dav1d_cdf_thread_unref
(
&
c
->
cdf
[
i
]);
}
c
->
frame_hdr
=
NULL
;
c
->
seq_hdr
=
NULL
;
dav1d_ref_dec
(
&
c
->
seq_hdr_ref
);
c
->
mastering_display
=
NULL
;
c
->
content_light
=
NULL
;
dav1d_ref_dec
(
&
c
->
mastering_display_ref
);
dav1d_ref_dec
(
&
c
->
content_light_ref
);
if
(
c
->
n_fc
==
1
)
return
;
// mark each currently-running frame as flushing, so that we
...
...
@@ -414,22 +430,6 @@ void dav1d_flush(Dav1dContext *const c) {
}
atomic_store
(
c
->
frame_thread
.
flush
,
0
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
if
(
c
->
refs
[
i
].
p
.
p
.
data
[
0
])
dav1d_thread_picture_unref
(
&
c
->
refs
[
i
].
p
);
dav1d_ref_dec
(
&
c
->
refs
[
i
].
segmap
);
dav1d_ref_dec
(
&
c
->
refs
[
i
].
refmvs
);
dav1d_cdf_thread_unref
(
&
c
->
cdf
[
i
]);
}
c
->
frame_hdr
=
NULL
;
c
->
seq_hdr
=
NULL
;
dav1d_ref_dec
(
&
c
->
seq_hdr_ref
);
c
->
mastering_display
=
NULL
;
c
->
content_light
=
NULL
;
dav1d_ref_dec
(
&
c
->
mastering_display_ref
);
dav1d_ref_dec
(
&
c
->
content_light_ref
);
c
->
frame_thread
.
next
=
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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