Fixed the bug where video capture hangs.