mpegdemux: refactor init and reset