[x265] input: fix race condition

Steve Borho steve at borho.org
Sun Jun 22 08:52:54 CEST 2014


On Sat, Jun 21, 2014 at 8:49 PM, Satoshi Nakagawa <nakagawa424 at oki.com> wrote:
> When eof detected, threadMain may overwrite frameStat[tail.get()] = false
> before read, no head check here.
> So, I moved frameStat[] = false to consumer.

ok, now I see what the patch is doing. it feels like there should be a
simpler way.  Like maybe not wrapping head and tail but using
modulo/mask on them when indexing into the ring buffer. Then it would
be unambiguous whether any frames were left in the ring at exit.

-- 
Steve Borho


More information about the x265-devel mailing list