got it streaming video, the reason for bad file descriptor was that the socket was close before the thread started running so I comment it out refer to main line 120. Also we did not send a comfirmation back to client that we are going start playing before streaming refer to line 109 main.c
removed sample.avi from project