shithub: dav1d

Download patch

ref: 67436a48ab89ed21a751fd4be6b5f92b3a5d136b
parent: 704a5252e43765bc3383d53c63e0ae4cde57d720
author: Janne Grunau <janne-vlc@jannau.net>
date: Tue Nov 6 16:45:37 EST 2018

threading: fix deadlock with multiple tile rows

Tile progress needs to be initilized to starting superblock row of the
tile row. Otherwise tile threads will wait indefinitely for a sb row of
a different tile.

--- a/src/decode.c
+++ b/src/decode.c
@@ -2813,8 +2813,10 @@
                 const int tile_start_off = f->frame_thread.tile_start_off[tile_idx];
                 ts->frame_thread.pal_idx = &f->frame_thread.pal_idx[tile_start_off * 2];
                 ts->frame_thread.cf = &((int32_t *) f->frame_thread.cf)[tile_start_off * 3];
-                if (f->n_tc > 0)
-                    atomic_init(&ts->progress, 0);
+                if (f->n_tc > 0) {
+                    unsigned row_sb_start = f->frame_hdr.tiling.row_start_sb[ts->tiling.row];
+                    atomic_init(&ts->progress, row_sb_start);
+                }
             }
         }
     }