Demux implementation.