handle EOS: block input thread (eos buffer) until output thread retrieve all buffers from yami
fix one output order issue: index == i
pass replay test
up ok
temp
clear device environment only when there is device event
fix mistake on device event clear