It works for decoding only in one thread. I use only one buffer, so when different frames are decoded in different threads I get wrong pieces in my result buffer. I don't know how to work with multiple buffers (which call of draw_horiz_band is for which frame?).