fix a double channel close, and a logic error in the mediaplayer