title: Setting a timeout for av_read_frame
body: <p>I am new to FFMPEG and was trying to do HLS streaming using FFMPEG. When i tried using the function "av_read_frame" it returns a negative value whenever data is not available. Is there some method to make this function wait till some data is received or to make this function wait till a timeout is reached?</p>