fixed the thread synch issue at the encoder. We need to protect the whole packet processing so the packet won't be corrupted.

Add video id to the smart packets and made corresponding changes to the player.