Refactored pcmain, moved receiving of streams to other threads to own function, getStreamFromStream. Consider moving into common.c, such that all threads can access this.