shithub: dav1d

Download patch

ref: 1aaa5836b917805a63d054a18b29a199f1993ad8
parent: 1d3f0266a839df9c190c1db1f5d660ea24f5c0a1
author: Luc Trudeau <ltrudeau@twoorioles.com>
date: Tue Mar 24 13:32:40 EDT 2020

const correctness in thread_task

--- a/src/thread_task.c
+++ b/src/thread_task.c
@@ -42,8 +42,7 @@
         if (f->frame_thread.die) break;
         pthread_mutex_unlock(&f->frame_thread.td.lock);
 
-        const int res = dav1d_decode_frame(f);
-        if (res)
+        if (dav1d_decode_frame(f))
             memset(f->frame_thread.cf, 0,
                    (size_t)f->frame_thread.cf_sz * 128 * 128 / 2);
 
@@ -92,8 +91,8 @@
             for (t->by = ts->tiling.row_start; t->by < ts->tiling.row_end;
                  t->by += f->sb_step)
             {
-                int error = dav1d_decode_tile_sbrow(t);
-                int progress = error ? TILE_ERROR : 1 + (t->by >> f->sb_shift);
+                const int error = dav1d_decode_tile_sbrow(t);
+                const int progress = error ? TILE_ERROR : 1 + (t->by >> f->sb_shift);
 
                 // signal progress
                 pthread_mutex_lock(&ts->tile_thread.lock);
@@ -128,7 +127,7 @@
             // waiting for the post-filter to complete
             t->ts = ts;
             t->by = sby << f->sb_shift;
-            int error = dav1d_decode_tile_sbrow(t);
+            const int error = dav1d_decode_tile_sbrow(t);
             progress = error ? TILE_ERROR : 1 + sby;
 
             // signal progress