demuxer: revert and fix previous commit - now without side-effects