add protection against EAGAIN error in the streams (thanks to vrabaud for the patch - ticket #553)

This commit is contained in:
Vadim Pisarevsky 2010-11-22 13:07:43 +00:00
parent e18427b139
commit 636cb15f3d

View File

@ -538,7 +538,13 @@ bool CvCapture_FFMPEG::grabFrame()
}
// get the next frame
while (!valid && (av_read_frame(ic, &packet) >= 0)) {
while (!valid) {
int ret = av_read_frame(ic, &packet);
if (ret == AVERROR(EAGAIN))
continue;
if (ret < 0)
break;
if( packet.stream_index != video_stream ) {
av_free_packet (&packet);
continue;