update demux implementation

Signed-off-by: Jack <jack.wgm@gmail.com>