Thx for your answer. Do you have any examples? Where need I use this callback? When I open the video? Which parameters are necessary to this function? I couldn't find much information searching on web.
2011/2/15 Steffen Ebersbach <ebers...@hs-mittweida.de>: > On 15.2.2011 13:27, Leandro Santiago wrote: >> >> Hello to all. >> >> In my app I'm continuously receiving video (mjpeg) from a web server, >> but when I close the connection (desconecting the network cable, for >> example), the app stay locked in the av_read_frame() call. Are there >> any ways to define a "timeout" when try to read a frame, and, when >> this time comes, the function returns with an error. >> >> Thx. >> _______________________________________________ >> libav-user mailing list >> libav-user@mplayerhq.hu >> https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > Hello, > > you have to set a callback function by your own to make a timeout in > blocking functions like av_read_frame. This is managed by > url_set_interrupt_cb(). In blocking functions the libary call your function > specified there. > Then you have to decide if the timeout ist needed or not. If you want the > blocking function to quit, because of an timeout, the return value must be > 0. > > Steffen > _______________________________________________ > libav-user mailing list > libav-user@mplayerhq.hu > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > _______________________________________________ libav-user mailing list libav-user@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/libav-user