shithub: dav1d

Download patch

ref: aee656d763cd9a6d1d1d4b248c8464cf8399bbb6
parent: 3d675c12334bff6b7e3758f51bcc519afd2f192f
author: Janne Grunau <[email protected]>
date: Wed Nov 28 15:16:16 EST 2018

clean state in dav1d_flush()

--- a/src/lib.c
+++ b/src/lib.c
@@ -359,6 +359,18 @@
     }
     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);
+        if (c->cdf[i].cdf)
+            dav1d_cdf_thread_unref(&c->cdf[i]);
+    }
+    c->frame_hdr = NULL;
+    c->seq_hdr = NULL;
+    dav1d_ref_dec(&c->seq_hdr_ref);
+
     c->frame_thread.next = 0;
 }