refactor flv decoder