fix bug of hls, close the muxer when segment finished